private static @Nullable Set<String> collectTargetModuleOutputPaths(@NotNull Set<String> libraryPaths,
                                                                      @Nullable MultiMap<ExternalSystemSourceType, String> gradleOutputs) {
    if (gradleOutputs == null) {
      return null;
    }

    final Set<String> compileSet = new HashSet<>();
    ContainerUtil.addAllNotNull(compileSet,
                                gradleOutputs.get(ExternalSystemSourceType.SOURCE));
    ContainerUtil.addAllNotNull(compileSet,
                                gradleOutputs.get(ExternalSystemSourceType.RESOURCE));
    if (ContainerUtil.intersects(libraryPaths, compileSet)) {
      return compileSet;
    }

    final Set<String> testSet = new HashSet<>();
    ContainerUtil.addAllNotNull(testSet,
                                gradleOutputs.get(ExternalSystemSourceType.TEST));
    ContainerUtil.addAllNotNull(testSet,
                                gradleOutputs.get(ExternalSystemSourceType.TEST_RESOURCE));
    if (ContainerUtil.intersects(libraryPaths, testSet)) {
      return testSet;
    }
    return null;
  }
private static @Nullable Set<String> collectTargetModuleOutputPaths(@NotNull Set<String> libraryPaths,
                                                                      @Nullable MultiMap<ExternalSystemSourceType, String> gradleOutputs)