### Question:
Polygon { public Rectangle getBoundingBox() { int lx = Integer.MAX_VALUE; int ly = Integer.MAX_VALUE; int hx = Integer.MIN_VALUE; int hy = Integer.MIN_VALUE; for (Point pt : points) { if (pt.getX() < lx) lx = pt.getX(); if (pt.getY() < ly) ly = pt.getY(); if (pt.getX() > hx) hx = pt.getX(); if (pt.getY() > hy) hy = pt.getY(); } return new Rectangle(new Point(lx, ly), new Point(hx, hy)); } Polygon(Point... points); Rectangle getBoundingBox(); List<Edge> extractEdges(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj);  }### Answer:
@Test public void testBoundingBox() { Polygon poly = new Polygon(new Point(1, 2), new Point(3, 3), new Point(6, 1)); Rectangle expected = new Rectangle(new Point(1,1), new Point(6,3)); Rectangle boundingBox = poly.getBoundingBox(); Assert.assertEquals(expected, boundingBox); }