@Test
  public void testPair() {
    String first = "abcdef";
    Long second = 23L;

    Pair<String, Long> pairOne = new Pair<>(first, second);
    Pair<String, Long> pairTwo = new Pair<>(first, second);
    Pair<String, Long> pairThree = new Pair<>(first, second + 1);
    Pair<String, Long> pairFour = new Pair<>(first + "extra", second);
    Pair<Long, String> pairFive = new Pair<>(second, first);

    assertEquals("Invalid first item.", first, pairOne.getFirst());
    assertEquals("Invalid second item.", second, pairOne.getSecond());
    assertEquals("These pairs should be equivalent", pairTwo, pairOne);
    assertFalse("pairOne and pairThree should not be equal", pairOne.equals(pairThree));
    assertFalse("pairOne and pairFour should not be equal", pairOne.equals(pairFour));
    assertFalse("pairOne and pairFive should not be equal", pairOne.equals(pairFive));
    assertEquals("Hashcodes should be the same", pairOne.hashCode(), pairTwo.hashCode());
    assertEquals("Pair{first=" + first + ", second=" + second + "}", pairOne.toString());
  }
Test the {@link Pair} class for correctness.
ambry-utils/src/test/java/com/github/ambry/utils/PairTest.java