private void removeFromAnnotation(@NotNull PsiAnnotation annotation) 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;
    PsiAnnotationMemberValue value = attribute.getValue();
    if (value instanceof PsiArrayInitializerMemberValue) {
      PsiAnnotationMemberValue[] initializers = ((PsiArrayInitializerMemberValue)value).getInitializers();
      for (PsiAnnotationMemberValue initializer : initializers) {
        if (removeFromValue(annotation, initializer, initializers.length == 1)) return;
      }
    }
    assert value != null;
    removeFromValue(annotation, value, attributes.length == 1);
  }
private void removeFromAnnotation(@NotNull PsiAnnotation annotation)