### Question:
BoundingBoxOverlay implements Overlay { @Override public void draw(Graphics graphics) { graphics.setColor(Colors.QUERY_REGION); for (LineSegment2d segment : myModel.getBoundingBox()) { Vector2d vertexA = segment.getVertexA(); Vector2d vertexB = segment.getVertexB(); graphics.drawLine((int)vertexA.getX(), (int)vertexA.getY(), (int)vertexB.getX(), (int)vertexB.getY()); } } BoundingBoxOverlay(MapModel mapModel); @Override void close(); @Override void draw(Graphics graphics);  }### Answer:
@Test public void test() { MapModel mapModel = new MapModel(); GeographicBoundingBox boundingBox = new GeographicBoundingBox(LatLonAlt.createFromDegrees(0d, 0d), LatLonAlt.createFromDegrees(45d, 90d)); mapModel.setRegion(boundingBox); mapModel.setHeightWidth(400, 400); mapModel.setViewport(new ScreenBoundingBox(new ScreenPosition(0d, 0d), new ScreenPosition(400, 400))); GraphicsMock graphics = new GraphicsMock(); BoundingBoxOverlay overlay = new BoundingBoxOverlay(mapModel); overlay.draw(graphics); Vector2d lowerLeft = new Vector2d(200, 200); Vector2d lowerRight = new Vector2d(300, 200); Vector2d upperLeft = new Vector2d(200, 100); Vector2d upperRight = new Vector2d(300, 100); List<LineSegment2d> expectedSegments = New.list(new LineSegment2d(lowerLeft, lowerRight), new LineSegment2d(lowerRight, upperRight), new LineSegment2d(upperRight, upperLeft), new LineSegment2d(upperLeft, lowerLeft)); List<LineSegment2d> actualSegments = graphics.getDrawnLines(); for (LineSegment2d expectedSegment : expectedSegments) { boolean isActual = false; for (LineSegment2d actualSegment : actualSegments) { if (actualSegment.getVertexA().equals(expectedSegment.getVertexA()) && actualSegment.getVertexB().equals(expectedSegment.getVertexB()) || actualSegment.getVertexA().equals(expectedSegment.getVertexB()) && actualSegment.getVertexB().equals(expectedSegment.getVertexA())) { isActual = true; break; } } assertTrue("Did not find segment " + expectedSegment, isActual); } }