private void getKeyValueDataOnAllClients(String key, String expectedValue, String expectedCookie)
      throws IOException, URISyntaxException {
    for (int i = 0; i < manager.numContainers(); i++) {
      // Set the port for this server
      client.setPort(Integer.parseInt(manager.getContainerPort(i)));
      // Get the response to a get on the specified key from this server
      Client.Response resp = client.get(key);

      // Null would mean we don't expect the same cookie as before
      if (expectedCookie != null) {
        assertEquals("Sessions are not replicating properly", expectedCookie,
            resp.getSessionCookie());
      }

      // Check that the response from this server is correct
      if (install.getConnectionType() == ContainerInstall.ConnectionType.CACHING_CLIENT_SERVER) {
        // There might be delay for other client cache to gets the update through
        // HARegionQueue
        String value = resp.getResponse();
        if (!expectedValue.equals(value)) {
          logger.info(
              "getKeyValueDataOnAllClients: verifying container \"{}\" for expected value of \"{}\""
                  + " for key \"{}\", but gets response value of \"{}\". Waiting for update from server.",
              i,
              expectedValue, key, value);
        }
        assertThat(getResponseValue(client, key)).isEqualTo(expectedValue);
      } else {
        // either p2p cache or client cache which has proxy/empty region - retrieving session from
        // servers
        assertEquals("Session data is not replicating properly", expectedValue, resp.getResponse());
      }
    }
  }
Gets the specified key from all the containers within the container manager and check that each
container has the associated expected value
geode-assembly/src/distributedTest/java/org/apache/geode/session/tests/CargoTestBase.java