private static PsiReferenceProcessor createReferenceProcessor(@NotNull List<UsagesProcessor> processors,
                                                                @NotNull GlobalInspectionContext context) {
    return reference -> {
      AnalysisScope scope = context.getRefManager().getScope();
      if (scope != null && scope.contains(reference.getElement()) && reference.getElement().getLanguage() == JavaLanguage.INSTANCE ||
          PsiTreeUtil.getParentOfType(reference.getElement(), PsiDocComment.class) != null) {
        return true;
      }

      synchronized (processors) {
        UsagesProcessor[] processorsArrayed = processors.toArray(new UsagesProcessor[0]);
        for (UsagesProcessor processor : processorsArrayed) {
          if (!processor.process(reference)) {
            processors.remove(processor);
          }
        }
      }

      return !processors.isEmpty();
    };
  }
private static PsiReferenceProcessor createReferenceProcessor(@NotNull List<UsagesProcessor> processors,
                                                                @NotNull GlobalInspectionContext context)