@Override
  public Cache createCache(Properties gemfireProperties, ServerLauncher serverLauncher) {
    final CacheFactory cacheFactory = new CacheFactory(gemfireProperties);
    InternalCache cache = (InternalCache) cacheFactory.create();

    CompletableFuture<Void> waitForFileTask = CompletableFuture.runAsync(this::waitForFileToExist);
    cache.getInternalResourceManager().addStartupTask(waitForFileTask);

    return cache;
  }
Adds a startup task which completes when a specific file is created in the working directory.
geode-assembly/src/acceptanceTest/java/org/apache/geode/launchers/startuptasks/WaitForFileToExist.java