### Question:
Polygon { @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Polygon other = (Polygon) obj; if (points == null) { if (other.points != null) return false; } else if (!points.equals(other.points)) return false; return true; } Polygon(Point... points); Rectangle getBoundingBox(); List<Edge> extractEdges(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj);  }### Answer:
@Test public void testEquals() { Polygon poly1 = new Polygon(new Point(1, 2), new Point(3, 3), new Point(6, 1)); Polygon poly2 = new Polygon(new Point(1, 2), new Point(3, 3), new Point(6, 1)); Polygon poly3 = new Polygon(new Point(1, 2), new Point(4, 3), new Point(6, 1)); Assert.assertTrue(poly1.equals(poly1)); Assert.assertTrue(poly1.equals(poly2)); Assert.assertFalse(poly1.equals(poly3)); Assert.assertFalse(poly1.equals(null)); }