private void updateGradleWorkerClasspathFile(List<String> command, int argIndex, Path directory) {
    String originalClasspathFileArg = command.get(argIndex);
    Matcher matcher = GRADLE_WORKER_CLASSPATH_FILE_PATTERN
        .matcher(originalClasspathFileArg);
    matcher.matches();
    Path originalClasspathFile = Paths.get(matcher.group().substring(1));
    Path newClasspathFile = directory.resolve("gradle-worker-classpath.txt");
    copy(originalClasspathFile, newClasspathFile);
    String newClasspathFileArg = "@" + newClasspathFile;
    command.set(argIndex, newClasspathFileArg);
  }
Replace all occurrences of "../" that are not proceeded by a / in the command with "../../"
to match the new working directory of the process. This fixes issues with java agent commands
like jacoco that pass relative paths, eg "-agentlib:../tmp/jacocoXXX=../jacoco/test.txt
@param command the command line to upgrade. It will be modified in place.
build-tools/geode-testing-isolation/src/main/java/org/apache/geode/gradle/testing/isolation/WorkingDirectoryIsolator.java