@Test
  public void testHashCode() {
    int testHashCode = connectionId1.hashCode();
    int expectedHashCode = ConnectionId.hashCode(testUser1, serviceName, address);
    assertEquals(expectedHashCode, testHashCode);

    // Make sure two objects are not same and test for hashcode
    assertNotEquals(connectionId1, connectionId2);
    assertNotEquals(connectionId1.hashCode(), connectionId2.hashCode());
  }
Test the hashcode for same object and different object with both hashcode function and static
hashcode function
hbase-client/src/test/java/org/apache/hadoop/hbase/ipc/TestConnectionId.java