private static PsiElement getParentSafe(@Nullable PsiElement element) {
    return element == null ? null : element.getParent();
  }
private static PsiElement getParentSafe(@Nullable PsiElement element)