private static void collectDependencies(RuntimeModuleDescriptor module, Set<RuntimeModuleId> visited, Set<Path> classpath) {
    if (visited.add(module.getModuleId())) {
      classpath.addAll(module.getResourceRootPaths());
      for (RuntimeModuleDescriptor dep : module.getDependencies()) {
        collectDependencies(dep, visited, classpath);
      }
    }
  }
private static void collectDependencies(RuntimeModuleDescriptor module, Set<RuntimeModuleId> visited, Set<Path> classpath)