// Path: src/main/java/org/weakref/jmx/JmxException.java
// public enum Reason
// {
//     INVALID_ANNOTATION,
//     MALFORMED_OBJECT_NAME,
//     INSTANCE_ALREADY_EXISTS,
//     INSTANCE_NOT_FOUND,
//     MBEAN_REGISTRATION
// }


import java.util.Set;
import java.util.TreeMap;
import static java.util.Arrays.asList;
import org.weakref.jmx.JmxException.Reason;
import javax.management.Descriptor;
import javax.management.DescriptorKey;
import javax.management.ImmutableDescriptor;
import java.lang.annotation.Annotation;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
                }
            }
        }

        Collections.addAll(result, annotations);
    }

    private static void processAnnotation(Annotation annotation, Map<String, Object> fieldsCollector)
    {
        // for each field in the annotation
        for (Method field : annotation.annotationType().getMethods()) {
            // if the field is annotated with the descriptor key
            DescriptorKey descriptorKey = field.getAnnotation(DescriptorKey.class);
            if (descriptorKey == null) {
                continue;
            }

            // name is the name of the method
            String name = descriptorKey.value();

            // invoke method to get the value
            Object value;
            try {
                value = field.invoke(annotation);
            }
            catch (Exception e) {
                Throwable cause = e;
                if (e instanceof InvocationTargetException) {
                    cause = e.getCause();
                }
// Path: src/main/java/org/weakref/jmx/JmxException.java
// public enum Reason
// {
//     INVALID_ANNOTATION,
//     MALFORMED_OBJECT_NAME,
//     INSTANCE_ALREADY_EXISTS,
//     INSTANCE_NOT_FOUND,
//     MBEAN_REGISTRATION
// }


// Path: src/main/java/org/weakref/jmx/AnnotationUtils.java
import java.util.Set;
import java.util.TreeMap;
import static java.util.Arrays.asList;
import org.weakref.jmx.JmxException.Reason;
import javax.management.Descriptor;
import javax.management.DescriptorKey;
import javax.management.ImmutableDescriptor;
import java.lang.annotation.Annotation;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;

                }
            }
        }

        Collections.addAll(result, annotations);
    }

    private static void processAnnotation(Annotation annotation, Map<String, Object> fieldsCollector)
    {
        // for each field in the annotation
        for (Method field : annotation.annotationType().getMethods()) {
            // if the field is annotated with the descriptor key
            DescriptorKey descriptorKey = field.getAnnotation(DescriptorKey.class);
            if (descriptorKey == null) {
                continue;
            }

            // name is the name of the method
            String name = descriptorKey.value();

            // invoke method to get the value
            Object value;
            try {
                value = field.invoke(annotation);
            }
            catch (Exception e) {
                Throwable cause = e;
                if (e instanceof InvocationTargetException) {
                    cause = e.getCause();
                }
                throw new JmxException(Reason.INVALID_ANNOTATION, cause,