### Question:
CollisionConstraint { @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + constraints.hashCode(); return result; } CollisionConstraint(); void add(Orientation orientation, String group); Map<Orientation, Collection<String>> getConstraints(); Collection<String> getConstraints(Orientation orientation); boolean has(Orientation orientation, String group); @Override int hashCode(); @Override boolean equals(Object object); @Override String toString();  }### Answer:
@Test void testHashCode() { final CollisionConstraint same = new CollisionConstraint(); same.add(Orientation.EAST, "group"); assertHashEquals(constraint, same); assertHashNotEquals(constraint, new Object()); final CollisionConstraint other = new CollisionConstraint(); other.add(Orientation.NORTH, "group"); assertHashNotEquals(constraint, other); final CollisionConstraint other2 = new CollisionConstraint(); other2.add(Orientation.EAST, "void"); assertHashNotEquals(constraint, other2); }