private static Pair.NonNull<PsiElement, String> checkAnnotationValue(@NotNull PsiClass annotation,
                                                               @NotNull PsiElement identifierToHighlight,
                                                               @NotNull String name,
                                                               @NotNull Set<? super String> usedAttrs,
                                                               @Nullable GrAnnotationMemberValue value) {
    if (!usedAttrs.add(name)) {
      return Pair.createNonNull(identifierToHighlight, GroovyBundle.message("duplicate.attribute"));
    }

    final PsiMethod[] methods = annotation.findMethodsByName(name, false);
    if (methods.length == 0) {
      return Pair.createNonNull(identifierToHighlight,
                                   GroovyBundle.message("at.interface.0.does.not.contain.attribute", annotation.getQualifiedName(), name));
    }
    final PsiMethod method = methods[0];
    final PsiType ltype = method.getReturnType();
    if (ltype != null && value != null) {
      return checkAnnotationValueByType(value, ltype, true);
    }
    return null;
  }
private static Pair.NonNull<PsiElement, String> checkAnnotationValue(@NotNull PsiClass annotation,
                                                               @NotNull PsiElement identifierToHighlight,
                                                               @NotNull String name,
                                                               @NotNull Set<? super String> usedAttrs,
                                                               @Nullable GrAnnotationMemberValue value)