private static void checkDuplicateModifiers(AnnotationHolder holder, @NotNull GrModifierList list, PsiElement member) {
    final PsiElement[] modifiers = list.getModifiers();
    if (modifiers.length <= 1) return;
    Set<String> set = new HashSet<>(modifiers.length);
    for (PsiElement modifier : modifiers) {
      if (modifier instanceof GrAnnotation) continue;
      @GrModifier.GrModifierConstant String name = modifier.getText();
      if (set.contains(name)) {
        String message = GroovyBundle.message("duplicate.modifier", name);
        AnnotationBuilder builder =
          holder.newAnnotation(HighlightSeverity.ERROR, message).range(modifier);
        GrModifierFix fix = member instanceof PsiMember ? new GrModifierFix((PsiMember)member, name, false, false, GrModifierFix.MODIFIER_LIST) :
                            member instanceof GrVariable ? new GrModifierFix((GrVariable)member, name, false, GrModifierFix.MODIFIER_LIST) :
                            null;
        if (member != null) {
          builder = registerLocalFix(builder, fix, list, message, ProblemHighlightType.ERROR, list.getTextRange());
        }
        builder.create();
      }
      else {
        set.add(name);
      }
    }
  }
private static void checkDuplicateModifiers(AnnotationHolder holder, @NotNull GrModifierList list, PsiElement member)