@ApiStatus.Internal
  @NotNull
  public static List<PsiElement> collectAllChildren(PsiElement e) {
    final List<PsiElement> result = new ArrayList<>();
    e.acceptChildren(new TopLevelVisitor() {
      @Override
      protected void checkAddElement(PsiElement node) {
        result.add(node);
      }
    });
    return result;
  }
@ApiStatus.Internal
  @NotNull
  public static List<PsiElement> collectAllChildren(PsiElement e)