@Override
  public int waitFor() throws InterruptedException {
    try {
      LOGGER.debug("{} waiting for process to finish", this);
      return delegate.waitFor();
    } finally {
      LOGGER.debug("{} finished", this);
      cleanUp();
    }
  }
Wraps a Java {@link Process} to execute a completion function when it terminates.
build-tools/geode-testing-isolation/src/main/java/org/apache/geode/gradle/testing/isolation/CompletableProcess.java