private static @Nullable PsiElement getContext(@Nullable PsiElement context) {
    while (context != null && !(context.getParent() instanceof PsiClass)) {
      context = context.getParent();
    }
    return context;
  }
private static @Nullable PsiElement getContext(@Nullable PsiElement context)