    @Test
    void constructors() {

        // We correctly assign slope and intercept
        Line base = new Line(-1, 2);
        assertEquals(base.slope, -1);
        assertEquals(base.intercept, 2);
        assertFalse(base.isVertical());

        // We convert from point slope to slope intercept properly
        Point p1 = new Point(-1000, 1002);
        Point p2 = new Point(10000, -9998);
        Line pointSlope1 = new Line(p1, -1);
        Line pointSlope2 = new Line(p2, -1);
        assertEquals(pointSlope1, base);
        assertEquals(pointSlope2, base);
        assertFalse(pointSlope1.isVertical());
        assertFalse(pointSlope2.isVertical());

        // We convert from point-point properly
        Line pointPoint = new Line(p1, p2);
        assertEquals(pointPoint, base);
        assertFalse(pointPoint.isVertical());

        // We cannot create vertical line with slope y-intercept constructor
        assertThrows(IllegalArgumentException.class, () -> {
            new Line(Double.NEGATIVE_INFINITY, 0);
        });

        // Vertical lines with +infinity slope equal those with -infinity slope
        Line posVertical = new Line(new Point(5, 0), Double.NEGATIVE_INFINITY);
        Line negVertical = new Line(new Point(5, 0), Double.NEGATIVE_INFINITY);
        assertEquals(posVertical, negVertical);
        assertEquals(negVertical.slope, Double.NEGATIVE_INFINITY);
        assertTrue(posVertical.isVertical());
        assertTrue(negVertical.isVertical());

        // Vertical line can be created from two points
        Line twoPointVertical = new Line(new Point(-2, -2), new Point(-2, -4));
        assertEquals(twoPointVertical.slope, Double.NEGATIVE_INFINITY);
        assertTrue(twoPointVertical.isVertical());
    }