private <T> @Nullable T processExports(@Nullable String name,
                                           @NotNull PsiJavaModule module,
                                           boolean direct,
                                           @NotNull Set<? super PsiJavaModule> visited,
                                           @NotNull BiFunction<? super String, ? super PsiJavaModule, ? extends T> processor) {
      if (visited.add(module)) {
        if (!direct) {
          for (PsiPackageAccessibilityStatement statement : module.getExports()) {
            List<String> exportTargets = statement.getModuleNames();
            if (exportTargets.isEmpty() || exportTargets.contains(name)) {
              T result = processor.apply(statement.getPackageName(), module);
              if (result != null) return result;
            }
          }
        }
        for (Iterator<PsiJavaModule> iterator = myGraph.getIn(module); iterator.hasNext();) {
          PsiJavaModule dependency = iterator.next();
          if (direct || myTransitiveEdges.contains(key(dependency, module))) {
            T result = processExports(name, dependency, false, visited, processor);
            if (result != null) return result;
          }
        }
      }

      return null;
    }
private <T> @Nullable T processExports(@Nullable String name,
                                           @NotNull PsiJavaModule module,
                                           boolean direct,
                                           @NotNull Set<? super PsiJavaModule> visited,
                                           @NotNull BiFunction<? super String, ? super PsiJavaModule, ? extends T> processor)