### Question:
Polygon { public List<Edge> extractEdges() { List<Edge> result = new ArrayList<Edge>(); for(int i = 0; i < points.size(); i++) { result.add(new Edge(points.get(i), points.get((i+1) % points.size()))); } return result; } Polygon(Point... points); Rectangle getBoundingBox(); List<Edge> extractEdges(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj);  }### Answer:
@Test public void testVertexExtraction() { Rectangle rect = new Rectangle(new Point(1,1), new Point(6, 3)); List<Edge> vertices = rect.extractEdges(); Edge vert = new Edge(new Point(1,1), new Point(6,1)); Assert.assertTrue(vertices.contains(vert)); vert = new Edge(new Point(1,1), new Point(1,3)); Assert.assertTrue(vertices.contains(vert)); vert = new Edge(new Point(1,3), new Point(6,3)); Assert.assertTrue(vertices.contains(vert)); vert = new Edge(new Point(6,3), new Point(6,1)); Assert.assertTrue(vertices.contains(vert)); }