@Nullable
  private static PsiElement toUpperLevel(@NotNull PsiElement element) {
    element = element.getParent();
    while (element != null && !(element instanceof PsiLambdaExpression) && !(element instanceof PsiAnonymousClass)) {
      element = element.getParent();
    }

    return getLatestElementInCurrentScope(element);
  }
@Nullable
  private static PsiElement toUpperLevel(@NotNull PsiElement element)