@Test
  public void startCacheServerDoesNothingWhenCacheServerAlreadyExists() {
    Cache cache = createCache();
    CacheServer cacheServer1 = mock(CacheServer.class, "CacheServer1");
    CacheServer cacheServer2 = mock(CacheServer.class, "CacheServer2");
    when(cache.getCacheServers()).thenReturn(Collections.singletonList(cacheServer1));
    when(cache.addCacheServer()).thenReturn(cacheServer1);
    ServerLauncher launcher = new Builder()
        .setControllableProcessFactory(() -> mock(ControllableProcess.class))
        .setDisableDefaultServer(true)
        .setServerLauncherCacheProvider((a, b) -> cache)
        .build();

    launcher.start();

    verifyNoMoreInteractions(cacheServer2);
  }
Unit tests for {@link ServerLauncher}.

@since GemFire 7.0
geode-core/src/test/java/org/apache/geode/distributed/ServerLauncherTest.java