public static @Unmodifiable @NotNull <T extends PsiElement> List<T> getChildrenOfTypeAsList(@Nullable PsiElement element, @NotNull Class<? extends T> aClass) {
    List<T> result = null;
    if (element != null) {
      for (PsiElement child = element.getFirstChild(); child != null; child = child.getNextSibling()) {
        if (aClass.isInstance(child)) {
          if (result == null) result = new SmartList<>();
          result.add(aClass.cast(child));
        }
      }
    }
    return result != null ? result : Collections.emptyList();
  }
public static @Unmodifiable @NotNull <T extends PsiElement> List<T> getChildrenOfTypeAsList(@Nullable PsiElement element, @NotNull Class<? extends T> aClass)