private void stopCacheServer(int port) {
    boolean foundServer = false;
    for (CacheServer cacheServer : getCache().getCacheServers()) {
      if (cacheServer.getPort() == port) {
        cacheServer.stop();
        assertThat(cacheServer.isRunning()).isFalse();
        foundServer = true;
        break;
      }
    }
    assertThat(foundServer).isTrue();
  }
Stops the cache server specified by port
geode-cq/src/distributedTest/java/org/apache/geode/internal/cache/PutAllClientServerDistributedTest.java