private void checkIpAddress() {
    try {
      String localhostIp = InetAddress.getByName(LOCAL_HOST).getHostAddress();
      Assert.assertEquals(localhostIp, HMSHandler.getThreadLocalIpAddress());
    } catch (UnknownHostException e) {
      Assert.assertTrue("InetAddress.getLocalHost threw an exception: " + e.getMessage(), false);
    }
  }
An implementation for MetaStoreEventListener which checks that the IP Address stored in
HMSHandler matches that of local host, for testing purposes.
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/IpAddressListener.java