@Test
  public void testThatConnectionLoadIsCorrectlyUpdatedForGatewayReceiverGroup() {
    final LocatorLoadSnapshot loadSnapshot = new LocatorLoadSnapshot();

    final ServerLocation serverLocation = new ServerLocation("localhost", 1);
    final String uniqueId = new InternalDistributedMember("localhost", 1).getUniqueId();
    final ServerLocationAndMemberId servLocAndMemberId =
        new ServerLocationAndMemberId(serverLocation, uniqueId);

    loadSnapshot.addServer(serverLocation, uniqueId, new String[] {GatewayReceiver.RECEIVER_GROUP},
        new ServerLoad(50, 1, 0, 1),
        LOAD_POLL_INTERVAL);

    LocatorLoadSnapshot.LoadHolder expectedLoadHolder =
        new LocatorLoadSnapshot.LoadHolder(serverLocation, 70, 8, LOAD_POLL_INTERVAL);

    loadSnapshot.updateConnectionLoadMap(serverLocation, uniqueId, expectedLoadHolder.getLoad(),
        expectedLoadHolder.getLoadPerConnection());

    Map<ServerLocationAndMemberId, ServerLoad> serverLoadMap =
        loadSnapshot.getGatewayReceiverLoadMap();
    assertThat(expectedLoadHolder.getLoad())
        .isEqualTo(serverLoadMap.get(servLocAndMemberId).getConnectionLoad());
    assertThat(expectedLoadHolder.getLoadPerConnection())
        .isEqualTo(serverLoadMap.get(servLocAndMemberId).getLoadPerConnection());
  }
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