@Test
  public void startWithDefaultPortInUseFailsWithBindException() {
    givenServerPortInUse(defaultServerPort);
    launcher = newBuilder()
        .setDisableDefaultServer(DEFAULT_SERVER_IS_NEEDED)
        .build();

    Throwable thrown = catchThrowable(() -> launcher.start());

    assertThat(thrown)
        .isInstanceOf(RuntimeException.class)
        .hasCauseInstanceOf(BindException.class);
  }
Integration tests for using {@link ServerLauncher} as an in-process API within an existing JVM.

@since GemFire 8.0
geode-core/src/integrationTest/java/org/apache/geode/distributed/ServerLauncherLocalIntegrationTest.java