private static @NotNull <E extends PsiElement> PsiElementProcessor.CollectElementsWithLimit<E> getProcessor(int limit, boolean set) {
    return set ? new PsiElementProcessor.CollectElementsWithLimit<>(limit, new HashSet<>())
               : new PsiElementProcessor.CollectElementsWithLimit<>(limit);
  }
private static @NotNull <E extends PsiElement> PsiElementProcessor.CollectElementsWithLimit<E> getProcessor(int limit, boolean set)