private @NotNull ModCommand removeFromAnnotationExternal(@NotNull PsiAnnotation annotation, @NotNull PsiModifierListOwner owner) throws IncorrectOperationException {
    PsiNameValuePair[] attributes = annotation.getParameterList().getAttributes();
    PsiNameValuePair attribute =
      ContainerUtil.find(attributes, attr -> PsiAnnotation.DEFAULT_REFERENCED_METHOD_NAME.equals(attr.getAttributeName()));
    if (attribute == null) return ModCommand.nop();
    PsiAnnotationMemberValue value = attribute.getValue();
    if (value instanceof PsiArrayInitializerMemberValue) {
      PsiAnnotationMemberValue[] initializers = ((PsiArrayInitializerMemberValue)value).getInitializers();
      for (PsiAnnotationMemberValue initializer : initializers) {
        ModCommand command = removeFromValueExternal(annotation, initializer, initializers.length == 1, owner);
        if (!command.isEmpty()) {
          return command;
        }
      }
    }
    assert value != null;
    return removeFromValueExternal(annotation, value, attributes.length == 1, owner);
  }
private @NotNull ModCommand removeFromAnnotationExternal(@NotNull PsiAnnotation annotation, @NotNull PsiModifierListOwner owner)