private List<NetworkInterface> getValidNetworkInterfaces() throws Exception {
    List<NetworkInterface> validNetworkInterfaces = new ArrayList<>();
    Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
    while (interfaces.hasMoreElements()) {
      NetworkInterface networkInterface = interfaces.nextElement();
      if (ignoreNetworkInterface(networkInterface)) {
        continue;
      }
      validNetworkInterfaces.add(networkInterface);
    }
    return validNetworkInterfaces;
  }
Tests for the hostname specification by region server
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerHostname.java