### Question:
Pair { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Pair<?, ?> pair = (Pair<?, ?>) o; return Objects.equals(first, pair.first) && Objects.equals(second, pair.second); } Pair(A first, B second); A first(); B second(); @Override int hashCode(); @Override boolean equals(Object o); @Override String toString();  }### Answer:
@Test public void testEquals() { Pair pairA = new Pair(5, "beers"); Pair pairB = new Pair(5, "beers"); Pair pairC = new Pair(10, "beeers"); assertEquals(pairA, pairB); assertEquals(pairB, pairA); assertNotEquals(pairA, pairC); assertNotEquals(pairC, pairA); }