PathDetail extends SketchDetail { public void lineTo(Coord2D point) { path.add(point); updateBoundingBox(point); } PathDetail(Coord2D start, Colour colour);  PathDetail(List<Coord2D> paths, Colour colour); void lineTo(Coord2D point); List<Coord2D> getPath(); @Override double getDistanceFrom(Coord2D point); @Override PathDetail translate(Coord2D point); List<SketchDetail> getPathFragmentsOutsideRadius(Coord2D targetPoint, double radius);  }
@Test public void testIntersectsRectangleReturnsTrueForRectangleThatEntersBoundingBox() { PathDetail pathDetail = new PathDetail(Coord2D.ORIGIN, Colour.BLACK); pathDetail.lineTo(new Coord2D(1.5, 1.5)); Assert.assertTrue( pathDetail.intersectsRectangle(new Coord2D(1, 1), new Coord2D(2, 2))); }
@Test public void testIntersectsRectangleReturnsFalseForRectangleOutsideBoundingBox() { PathDetail pathDetail = new PathDetail(Coord2D.ORIGIN, Colour.BLACK); pathDetail.lineTo(new Coord2D(1.5, 1.5)); Assert.assertFalse( pathDetail.intersectsRectangle(new Coord2D(2, 2), new Coord2D(3, 3))); }