public ServerName findServerWithSameHostnamePortWithLock(final ServerName serverName) {
    ServerName end =
      ServerName.valueOf(serverName.getHostname(), serverName.getPort(), Long.MAX_VALUE);

    ServerName r = onlineServers.lowerKey(end);
    if (r != null) {
      if (ServerName.isSameAddress(r, serverName)) {
        return r;
      }
    }
    return null;
  }
Assumes onlineServers is locked.
@return ServerName with matching hostname and port.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java