@Override
  public void after() {
    restore.after();
    // invoke stop() first and then ds.disconnect
    stopMember();

    disconnectDSIfAny();
    // this will clean up the SocketCreators created in this VM so that it won't contaminate
    // future tests
    SocketCreatorFactory.close();

    // This is required if PDX is in use and tests are run repeatedly.
    TypeRegistry.init();

    // delete the first-level children files that are created in the tests
    if (cleanWorkingDir) {
      Arrays.stream(getWorkingDir().listFiles())
          // do not delete the pre-existing files
          .filter(f -> !firstLevelChildrenFile.contains(f))
          // do not delete the dunit folder that might have been created by dunit launcher
          .filter(f -> !(f.isDirectory() && f.getName().equals("dunit")))
          .forEach(FileUtils::deleteQuietly);
    }
  }
the abstract class that's used by LocatorStarterRule and ServerStarterRule to avoid code
duplication.

The rule will try to clean up the working dir as best as it can. Any first level children
created in the test will be cleaned up after the test.
geode-dunit/src/main/java/org/apache/geode/test/junit/rules/MemberStarterRule.java