public String buildGradleCommand() {
    StringBuilder command = new StringBuilder();

    int testCount = 0;
    for (Map.Entry<String, Set<String>> entry : sourceToTestMapping.entrySet()) {
      String sourceSet = entry.getKey();
      if (sourceToGradleMapping.get(sourceSet) == null) {
        System.err.println("Skipping repeat test for " + sourceSet);
        continue;
      }

      command.append(sourceToGradleMapping.get(sourceSet));
      entry.getValue().forEach(x -> command.append(" --tests ").append(x));
      command.append(" ");
      testCount += entry.getValue().size();
    }

    // This exists so that scripts processing this output can extract the number of tests
    // included here. Yes, it's pretty hacky...
    command.append("-PtestCount=" + testCount);

    return command.toString();
  }
This class is intended as a helper to the CI StressNewTest job. Given a list of changed test java
files, it expands the list to include any subclasses and outputs a partial Gradle command line to
execute those tests depending on the 'category' of test (unit, distributed, etc.).
geode-junit/src/main/java/org/apache/geode/test/util/StressNewTestHelper.java