void acceptElements(@NotNull List<? extends PsiElement> elements,
                      @NotNull List<? extends Class<?>> acceptingPsiTypes,
                      @NotNull Consumer<? super PsiElement> consumer) {
    if (acceptingPsiTypes == ALL_ELEMENTS_VISIT_LIST) {
      for (int i = 0; i < elements.size(); i++) {
        PsiElement element = elements.get(i);
        ProgressManager.checkCanceled();
        consumer.accept(element);
      }
    }
    else {
      Set<Class<?>> accepts = getVisitorAcceptClasses(acceptingPsiTypes);
      if (accepts != null && !accepts.isEmpty()) {
        for (int i = 0; i < elements.size(); i++) {
          PsiElement element = elements.get(i);
          if (accepts.contains(element.getClass())) {
            ProgressManager.checkCanceled();
            consumer.accept(element);
          }
        }
      }
    }
  }
void acceptElements(@NotNull List<? extends PsiElement> elements,
                      @NotNull List<? extends Class<?>> acceptingPsiTypes,
                      @NotNull Consumer<? super PsiElement> consumer)