private boolean hasEndPointWithPort(final PoolImpl pool, final int port) {
    EndpointManager endpointManager = pool.getEndpointManager();
    final Set<ServerLocationAndMemberId> slAndMemberIds = endpointManager.getEndpointMap().keySet();
    return slAndMemberIds.stream()
        .anyMatch(slAndMemberId -> slAndMemberId.getServerLocation().getPort() == port);
  }
Check to see if a client is connected to an endpoint with a specific port
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/UpdatePropagationDistributedTest.java