public static boolean containsLocalIp(List<InetSocketAddress> clusterAddresses,
      AlluxioConfiguration conf) {
    String localAddressIp = getLocalIpAddress((int) conf.getMs(PropertyKey
        .NETWORK_HOST_RESOLUTION_TIMEOUT_MS));
    for (InetSocketAddress addr : clusterAddresses) {
      String clusterNodeIp;
      try {
        clusterNodeIp = InetAddress.getByName(addr.getHostName()).getHostAddress();
        if (clusterNodeIp.equals(localAddressIp)) {
          return true;
        }
      } catch (UnknownHostException e) {
        LOG.error("Get raft cluster node ip by hostname({}) failed",
            addr.getHostName(), e);
      }
    }
    return false;
  }
@Test
  public void testContainsLocalIP() {
    List<InetSocketAddress> clusterAddresses = new ArrayList<>();
    InetSocketAddress raftNodeAddress1 = new InetSocketAddress(NetworkAddressUtils
        .getLocalHostName(
            (int) mConfiguration.getMs(PropertyKey.NETWORK_HOST_RESOLUTION_TIMEOUT_MS)),
        10);
    InetSocketAddress raftNodeAddress2 = new InetSocketAddress("host2", 20);
    InetSocketAddress raftNodeAddress3 = new InetSocketAddress("host3", 30);
    clusterAddresses.add(raftNodeAddress1);
    clusterAddresses.add(raftNodeAddress2);
    clusterAddresses.add(raftNodeAddress3);
    assertTrue(NetworkAddressUtils.containsLocalIp(clusterAddresses, mConfiguration));
  }