public void stop(Path directory) {
    Path absoluteDirectory = rootFolder.resolve(directory).normalize();
    String command = stopCommand(absoluteDirectory);
    String scriptName =
        String.format("Stop-%s-%s", processType.name().toLowerCase(),
            absoluteDirectory.getFileName());
    try {
      executor.execute(GfshScript.of(command).withName(scriptName));
      awaitStop(absoluteDirectory);
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
Provides methods for stopping and awaiting the termination of server and locator processes.
geode-junit/src/main/java/org/apache/geode/test/junit/rules/gfsh/GfshStopper.java