public static <T extends PsiElement> T @Nullable [] getChildrenOfType(@Nullable PsiElement element, @NotNull Class<T> aClass) {
    if (element == null) return null;
    List<T> result = getChildrenOfTypeAsList(element, aClass);
    return result.isEmpty() ? null : ArrayUtil.toObjectArray(result, aClass);
  }
public static <T extends PsiElement> T @Nullable [] getChildrenOfType(@Nullable PsiElement element, @NotNull Class<T> aClass)