@VisibleForTesting
  List<LoadHolder> findBestServers(
      Map<?, LoadHolder> groupServers,
      Set<ServerLocation> excludedServers, int count) {

    if (count == 0) {
      return new ArrayList<>();
    }

    TreeSet<LoadHolder> bestEntries = new TreeSet<>((l1, l2) -> {
      int difference = Float.compare(l1.getLoad(), l2.getLoad());
      if (difference != 0) {
        return difference;
      }
      ServerLocation sl1 = l1.getLocation();
      ServerLocation sl2 = l2.getLocation();
      return sl1.compareTo(sl2);
    });

    boolean retainAll = (count < 0);
    float lastBestLoad = Float.MAX_VALUE;

    for (Map.Entry<?, LoadHolder> loadEntry : groupServers.entrySet()) {
      ServerLocation location;
      Object key = loadEntry.getKey();
      if (key instanceof ServerLocationAndMemberId) {
        location = ((ServerLocationAndMemberId) key).getServerLocation();
      } else if (key instanceof ServerLocation) {
        location = ((ServerLocation) key);
      } else {
        throw new InternalGemFireException(
            "findBestServers method was called with incorrect type parameters.");
      }
      if (excludedServers.contains(location)) {
        continue;
      }

      LoadHolder nextLoadReference = loadEntry.getValue();
      float nextLoad = nextLoadReference.getLoad();

      if ((bestEntries.size() < count) || retainAll || (nextLoad < lastBestLoad)) {
        bestEntries.add(nextLoadReference);
        if (!retainAll && (bestEntries.size() > count)) {
          bestEntries.remove(bestEntries.last());
        }
        LoadHolder lastBestHolder = bestEntries.last();
        lastBestLoad = lastBestHolder.getLoad();
      }
    }

    return new ArrayList<>(bestEntries);
  }
@param groupServers the servers to consider
@param excludedServers servers to exclude
@param count how many you want. a negative number means all of them in order of best to worst
@return a list of best...worst server LoadHolders
geode-core/src/main/java/org/apache/geode/distributed/internal/LocatorLoadSnapshot.java