private static boolean isDefinedInParentScope(@NotNull String name, @NotNull PsiElement anchor) {
    return ScopeUtil.getDeclarationScopeOwner(ScopeUtil.getScopeOwner(anchor), name) != null;
  }
private static boolean isDefinedInParentScope(@NotNull String name, @NotNull PsiElement anchor)