### Question:
Edge { @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Edge other = (Edge) obj; if (head == null) { if (other.head != null) return false; } else if (!head.equals(other.head)) { if(!head.equals(other.tail)) return false; } if (tail == null) { if (other.tail != null) return false; } else if (!tail.equals(other.tail)) { if(!tail.equals(other.head)) return false; } return true; } Edge(Point tail, Point head); Point getHead(); Point getTail(); int length(); Vector getDirection(); @Override int hashCode(); @Override boolean equals(Object obj);  }### Answer:
@Test public void testEquals() { Edge vert1 = new Edge(new Point(0, 0), new Point(2, 0)); Edge vert2 = new Edge(new Point(0, 0), new Point(2, 0)); Edge vert3 = new Edge(new Point(0, 0), new Point(2, 1)); Edge vert4 = new Edge(new Point(2, 0), new Point(0, 0)); Assert.assertTrue(vert1.equals(vert1)); Assert.assertTrue(vert1.equals(vert2)); Assert.assertTrue(vert1.equals(vert4)); Assert.assertFalse(vert1.equals(vert3)); Assert.assertFalse(vert1.equals(null)); }