// Path: src/main/java/org/pdfsam/eventstudio/util/RequireUtils.java
// public static void requireNotNull(Object victim) {
//     if (victim == null) {
//         throw new IllegalArgumentException("The input object cannot be null");
//     }
// }
// 
// Path: src/main/java/org/pdfsam/eventstudio/Annotations.java
// static class ReflectiveListenerDescriptor {
// 
//     private final EventListener listenerAnnotation;
//     private final Method method;
// 
//     public ReflectiveListenerDescriptor(EventListener listenerAnnotation, Method method) {
//         this.listenerAnnotation = listenerAnnotation;
//         this.method = method;
//     }
// 
//     public EventListener getListenerAnnotation() {
//         return listenerAnnotation;
//     }
// 
//     public Method getMethod() {
//         return method;
//     }
// }
// 
// Path: src/main/java/org/pdfsam/eventstudio/exception/BroadcastInterruptionException.java
// public class BroadcastInterruptionException extends EventStudioException {
// 
//     public BroadcastInterruptionException(String message) {
//         super(message);
//     }
// 
// }
// 
// Path: src/main/java/org/pdfsam/eventstudio/exception/EventStudioException.java
// public class EventStudioException extends RuntimeException {
// 
//     public EventStudioException(String message, Throwable cause) {
//         super(message, cause);
//     }
// 
//     public EventStudioException(String message) {
//         super(message);
//     }
// 
//     public EventStudioException(Throwable cause) {
//         super(cause);
//     }
// 
// }


import org.pdfsam.eventstudio.Annotations.ReflectiveListenerDescriptor;
import org.pdfsam.eventstudio.exception.BroadcastInterruptionException;
import org.pdfsam.eventstudio.exception.EventStudioException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import static org.pdfsam.eventstudio.util.RequireUtils.requireNotNull;
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;
import java.util.Set;
import java.util.TreeSet;
import java.util.concurrent.locks.ReentrantReadWriteLock;
            }
            if (!(o instanceof DefaultListenerWrapper)) {
                return false;
            }
            DefaultListenerWrapper other = (DefaultListenerWrapper) o;
            return wrapped.equals(other.wrapped);
        }
    }

    /**
     * Reflective invocation of an annotated listener
     *
     * @author Andrea Vacondio
     */
    private static final class ReflectiveListenerWrapper implements ListenerWrapper {
        private final Object bean;
        private final Method method;

        public ReflectiveListenerWrapper(Object bean, Method method) {
            this.bean = bean;
            this.method = method;
            this.method.setAccessible(true);
        }

        public void onEvent(Envelope event) {
            try {
                method.invoke(bean, event.getEvent());
            } catch (IllegalAccessException e) {
                throw new EventStudioException("Exception invoking reflective method", e);
            } catch (InvocationTargetException e) {
// Path: src/main/java/org/pdfsam/eventstudio/util/RequireUtils.java
// public static void requireNotNull(Object victim) {
//     if (victim == null) {
//         throw new IllegalArgumentException("The input object cannot be null");
//     }
// }
// 
// Path: src/main/java/org/pdfsam/eventstudio/Annotations.java
// static class ReflectiveListenerDescriptor {
// 
//     private final EventListener listenerAnnotation;
//     private final Method method;
// 
//     public ReflectiveListenerDescriptor(EventListener listenerAnnotation, Method method) {
//         this.listenerAnnotation = listenerAnnotation;
//         this.method = method;
//     }
// 
//     public EventListener getListenerAnnotation() {
//         return listenerAnnotation;
//     }
// 
//     public Method getMethod() {
//         return method;
//     }
// }
// 
// Path: src/main/java/org/pdfsam/eventstudio/exception/BroadcastInterruptionException.java
// public class BroadcastInterruptionException extends EventStudioException {
// 
//     public BroadcastInterruptionException(String message) {
//         super(message);
//     }
// 
// }
// 
// Path: src/main/java/org/pdfsam/eventstudio/exception/EventStudioException.java
// public class EventStudioException extends RuntimeException {
// 
//     public EventStudioException(String message, Throwable cause) {
//         super(message, cause);
//     }
// 
//     public EventStudioException(String message) {
//         super(message);
//     }
// 
//     public EventStudioException(Throwable cause) {
//         super(cause);
//     }
// 
// }


// Path: src/main/java/org/pdfsam/eventstudio/Listeners.java
import org.pdfsam.eventstudio.Annotations.ReflectiveListenerDescriptor;
import org.pdfsam.eventstudio.exception.BroadcastInterruptionException;
import org.pdfsam.eventstudio.exception.EventStudioException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import static org.pdfsam.eventstudio.util.RequireUtils.requireNotNull;
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;
import java.util.Set;
import java.util.TreeSet;
import java.util.concurrent.locks.ReentrantReadWriteLock;

            }
            if (!(o instanceof DefaultListenerWrapper)) {
                return false;
            }
            DefaultListenerWrapper other = (DefaultListenerWrapper) o;
            return wrapped.equals(other.wrapped);
        }
    }

    /**
     * Reflective invocation of an annotated listener
     *
     * @author Andrea Vacondio
     */
    private static final class ReflectiveListenerWrapper implements ListenerWrapper {
        private final Object bean;
        private final Method method;

        public ReflectiveListenerWrapper(Object bean, Method method) {
            this.bean = bean;
            this.method = method;
            this.method.setAccessible(true);
        }

        public void onEvent(Envelope event) {
            try {
                method.invoke(bean, event.getEvent());
            } catch (IllegalAccessException e) {
                throw new EventStudioException("Exception invoking reflective method", e);
            } catch (InvocationTargetException e) {
                if (e.getCause() instanceof BroadcastInterruptionException) {