public static boolean checkName(@NotNull PsiElement element, @NotNull String name, @NotNull PsiElement context) {
    if (element instanceof PsiVariable && ((PsiVariable)element).isUnnamed()) return false;
    if (element instanceof PsiMetaOwner) {
      PsiMetaData data = ((PsiMetaOwner) element).getMetaData();
      if (data != null) {
        return name.equals(data.getName(context));
      }
    }
    return element instanceof PsiNamedElement && name.equals(((PsiNamedElement)element).getName());
  }
public static boolean checkName(@NotNull PsiElement element, @NotNull String name, @NotNull PsiElement context)