@Test
  public void portCanBeOverriddenBySystemProperty() {
    // given: overridden default port
    int overriddenPort = getRandomAvailableTCPPort();
    System.setProperty(TEST_OVERRIDE_DEFAULT_PORT_PROPERTY, String.valueOf(overriddenPort));

    // when: creating new LocatorLauncher
    LocatorLauncher launcher = new Builder().build();

    // then: locator port should be the overridden default port
    assertThat(launcher.getPort()).isEqualTo(overriddenPort);
  }
Integration tests for using {@link LocatorLauncher} as an in-process API within an existing JVM.
geode-core/src/integrationTest/java/org/apache/geode/distributed/LocatorLauncherIntegrationTest.java