### Question:
UnorderedPair extends SameTypePair<T> { @Override public int hashCode() { return Objects.hashCode(first()) + Objects.hashCode(second()); } UnorderedPair(T first, T second); @Override boolean equals(Object obj); @Override int hashCode();  }### Answer:
@Test public void equalObjectsShouldHaveSameHashCode() { assertEquals(new UnorderedPair<>("test", "test").hashCode(), new UnorderedPair<>("test", "test").hashCode()); assertEquals(new UnorderedPair<>("test1", "test").hashCode(), new UnorderedPair<>("test", "test1").hashCode()); assertEquals(new UnorderedPair<>(null, "test").hashCode(), new UnorderedPair<>(null, "test").hashCode()); assertEquals(new UnorderedPair<>(null, "test").hashCode(), new UnorderedPair<>("test", null).hashCode()); assertEquals(new UnorderedPair<>("test", null).hashCode(), new UnorderedPair<>("test", null).hashCode()); assertEquals(new UnorderedPair<>("test", null).hashCode(), new UnorderedPair<>(null, "test").hashCode()); assertEquals(new UnorderedPair<>(null, null).hashCode(), new UnorderedPair<>(null, null).hashCode()); }