@Test
  public void testExcludes() {
    final LocatorLoadSnapshot sn = new LocatorLoadSnapshot();
    final ServerLocation l1 = new ServerLocation("localhost", 1);
    final ServerLocation l2 = new ServerLocation("localhost", 2);
    final String uniqueId1 = new InternalDistributedMember("localhost", 1).getUniqueId();
    final String uniqueId2 = new InternalDistributedMember("localhost", 2).getUniqueId();
    sn.addServer(l1, uniqueId1, new String[0], new ServerLoad(1, 1, 1, 1), LOAD_POLL_INTERVAL);
    sn.addServer(l2, uniqueId2, new String[0], new ServerLoad(100, 1, 100, 1), LOAD_POLL_INTERVAL);

    Set<ServerLocation> excludeAll = new HashSet<>();
    excludeAll.add(l1);
    excludeAll.add(l2);

    assertThat(sn.getServerForConnection(null, Collections.emptySet())).isEqualTo(l1);
    assertThat(sn.getServerForConnection(null, Collections.singleton(l1))).isEqualTo(l2);

    assertThat(sn.getServerForConnection(null, excludeAll)).isEqualTo(null);
    assertThat(sn.getServersForQueue(null, Collections.singleton(l1), 3)).isEqualTo(
        Collections.singletonList(l2));

    assertThat(sn.getServersForQueue(null, excludeAll, 3)).isEqualTo(Collections.emptyList());
  }
Test that we can specify a list of servers to exclude and the snapshot honors the request when
picking the best server.
geode-core/src/test/java/org/apache/geode/distributed/internal/LocatorLoadSnapshotTest.java