### Question:
Pair implements Serializable { @Override public int hashCode() { return Objects.hashCode(first) ^ Objects.hashCode(second); } Pair(A first, B second); A getFirst(); B getSecond(); @Override int hashCode(); @Override boolean equals(Object o); @Override String toString();  }### Answer:
@Test public void testHashCode() { assertEquals(new Pair<>(3.0, "foo").hashCode(), new Pair<>(3.0, "foo").hashCode()); assertEquals(new Pair<>(null, null).hashCode(), new Pair<>(null, null).hashCode()); }