@Test
  public void buildWithWorkingDirectoryNotEqualToCurrentDirectoryThrowsIllegalStateException() {
    // given: using LocatorLauncher in-process

    // when: setting WorkingDirectory to non-current directory
    Throwable thrown = catchThrowable(() -> new Builder()
        .setCommand(Command.START)
        .setMemberName("memberOne")
        .setWorkingDirectory(getWorkingDirectoryPath())
        .build());

    // then: throw IllegalStateException
    then(thrown)
        .isExactlyInstanceOf(IllegalStateException.class)
        .hasMessage(workingDirectoryOptionNotValidErrorMessage());
  }
Integration tests for using {@link ServerLauncher} as an in-process API within an existing JVM.
geode-core/src/integrationTest/java/org/apache/geode/distributed/ServerLauncherIntegrationTest.java