### Question:
Vertex implements Serializable { @Override public int hashCode() { return Objects.hash(actor, action, isSpecial()); } protected  Vertex(String actor, String action, boolean isSpecial, String filePath,
                     List<Integer> lineNumbers, String location); boolean isLineNumbersEmpty(); String getActor(); String getAction(); boolean isSpecial(); String getFilePath(); List<Integer> getLineNumbers(); String getLocation(); void setLocation(String location); String shortenName(String name); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object o);  }### Answer:
@Test public void testHashCodeEquals() { Vertex vertex1 = new Vertex.Builder("com.actor", "action").markSpecial().build(); Vertex vertex2 = new Vertex.Builder("com.actor", "action").markSpecial().build(); int vertex1HashCode = vertex1.hashCode(); int vertex2HashCode = vertex2.hashCode(); assertEquals(vertex1, vertex2); assertEquals(vertex1HashCode, vertex2HashCode); assertEquals(vertex1, vertex2); assertEquals(vertex1.hashCode(), vertex2.hashCode()); assertEquals(vertex1HashCode, vertex1.hashCode()); assertEquals(vertex2HashCode, vertex2.hashCode()); }
@Test public void testHashCode() { assertTrue(vertex.hashCode() != 0); }
@Test public void testHashCodeEqualsWithSameClass() { TestVertex testVertex1 = new TestVertex.Builder("com.actor", "action").markSpecial().build(); TestVertex testVertex2 = new TestVertex.Builder("com.actor", "action").markSpecial().build(); int vertex1HashCode = testVertex1.hashCode(); int vertex2HashCode = testVertex2.hashCode(); assertEquals(testVertex1, testVertex2); assertEquals(vertex1HashCode, vertex2HashCode); assertEquals(vertex1HashCode, testVertex1.hashCode()); assertEquals(vertex2HashCode, testVertex2.hashCode()); }
@Test public void testHashCodeNotEqualsWithParentClass() { Vertex vertex1 = new Vertex.Builder("com.actor", "action").markSpecial().build(); TestVertex testVertex2 = new TestVertex.Builder("com.actor", "action").markSpecial().build(); int vertex1HashCode = vertex1.hashCode(); int vertex2HashCode = testVertex2.hashCode(); assertNotEquals(vertex1, testVertex2); assertNotEquals(vertex1HashCode, vertex2HashCode); assertEquals(vertex1HashCode, vertex1.hashCode()); assertEquals(vertex2HashCode, testVertex2.hashCode()); }