@Contract("null, _ -> null")
  public static @Nullable <E extends PsiElement> E getStubOrPsiParentOfType(@Nullable PsiElement element, @NotNull Class<E> parentClass) {
    if (element instanceof StubBasedPsiElement) {
      StubElement<?> stub = ((StubBasedPsiElement<?>)element).getStub();
      if (stub != null) {
        return stub.getParentStubOfType(parentClass);
      }
    }
    return getParentOfType(element, parentClass);
  }
@Contract("null, _ -> null")
  public static @Nullable <E extends PsiElement> E getStubOrPsiParentOfType(@Nullable PsiElement element, @NotNull Class<E> parentClass)