### Question:
Circuit { @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + groups.hashCode(); result = prime * result + type.hashCode(); return result; } Circuit(CircuitType type, String groupIn, String groupOut); CircuitType getType(); String getIn(); String getOut(); @Override int hashCode(); @Override boolean equals(Object object); @Override String toString();  }### Answer:
@Test void testHashCode() { final CircuitType type = CircuitType.TOP; final Circuit circuit = new Circuit(type, "a", "a"); assertHashEquals(circuit, circuit); assertHashEquals(new Circuit(type, "a", "a"), new Circuit(type, "a", "a")); assertHashEquals(new Circuit(type, "a", "b"), new Circuit(type, "a", "b")); assertHashNotEquals(new Circuit(CircuitType.MIDDLE, "a", "b"), new Circuit(CircuitType.MIDDLE.getSymetric(), "b", "a")); assertHashNotEquals(new Circuit(type, "a", "b"), new Circuit(type.getSymetric(), "b", "a")); assertHashNotEquals(new Circuit(type, "a", "a"), new Object()); assertHashNotEquals(new Circuit(type, "a", "b"), new Circuit(CircuitType.MIDDLE, "b", "a")); assertHashNotEquals(new Circuit(type, "a", "b"), new Circuit(CircuitType.MIDDLE, "a", "b")); assertHashNotEquals(new Circuit(type, "a", "b"), new Circuit(type, "a", "a")); assertHashNotEquals(new Circuit(type, "a", "b"), new Circuit(type, "b", "b")); assertHashNotEquals(new Circuit(type, "a", "a"), new Circuit(type, "b", "a")); assertHashNotEquals(new Circuit(type, "a", "a"), new Circuit(type, "b", "b")); assertHashNotEquals(new Circuit(type, "a", "a"), new Circuit(type.getSymetric(), "b", "b")); }