// Path: src/main/java/org/pdfsam/eventstudio/Annotations.java
// static class ReflectiveMetadata {
//     private String station;
//     private final Map<String, List<ReflectiveListenerDescriptor>> descriptors = new HashMap<>();
// 
//     private void put(String station, ReflectiveListenerDescriptor descriptor) {
//         List<ReflectiveListenerDescriptor> current = descriptors.computeIfAbsent(station, k -> new ArrayList<>());
//         current.add(descriptor);
//     }
// 
//     public String getStation() {
//         return station;
//     }
// 
//     public Map<String, List<ReflectiveListenerDescriptor>> getDescriptors() {
//         return descriptors;
//     }
// 
// }
// 
// 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 static org.junit.Assert.assertEquals;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import java.lang.reflect.InvocationTargetException;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InOrder;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.junit.MockitoJUnitRunner;
import org.pdfsam.eventstudio.Annotations.ReflectiveMetadata;
import org.pdfsam.eventstudio.annotation.EventListener;
import org.pdfsam.eventstudio.exception.BroadcastInterruptionException;
import org.pdfsam.eventstudio.exception.EventStudioException;
        verify(mockListener).onEvent(event);
        verify(anotherMockListener).onEvent(event);
    }

    @Test
    public void annotatedAddAndBroadcast() throws IllegalAccessException, InvocationTargetException {
        Object event = new Object();
        TestPrioritizedAnnotatedBean bean = new TestPrioritizedAnnotatedBean();
        ReflectiveMetadata metadata = Annotations.process(bean);
        TestPrioritizedAnnotatedBean spy = spy(bean);
        victim.addAll(spy, metadata.getDescriptors().get(""));
        victim.broadcast(event);
        verify(spy).first(event);
        verify(spy).second(event);
    }

    @Test
    public void priority() {
        Object event = new Object();
        InOrder inOrder = Mockito.inOrder(anotherMockListener, mockListener);
        victim.add(mockListener, 0, ReferenceStrength.STRONG);
        victim.add(anotherMockListener, -1, ReferenceStrength.STRONG);
        victim.broadcast(event);
        inOrder.verify(anotherMockListener).onEvent(event);
        inOrder.verify(mockListener).onEvent(event);
    }

    @Test
    public void broadcastInterrupted() {
        Object event = new Object();
// Path: src/main/java/org/pdfsam/eventstudio/Annotations.java
// static class ReflectiveMetadata {
//     private String station;
//     private final Map<String, List<ReflectiveListenerDescriptor>> descriptors = new HashMap<>();
// 
//     private void put(String station, ReflectiveListenerDescriptor descriptor) {
//         List<ReflectiveListenerDescriptor> current = descriptors.computeIfAbsent(station, k -> new ArrayList<>());
//         current.add(descriptor);
//     }
// 
//     public String getStation() {
//         return station;
//     }
// 
//     public Map<String, List<ReflectiveListenerDescriptor>> getDescriptors() {
//         return descriptors;
//     }
// 
// }
// 
// 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/test/java/org/pdfsam/eventstudio/StationTest.java
import static org.junit.Assert.assertEquals;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import java.lang.reflect.InvocationTargetException;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InOrder;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.junit.MockitoJUnitRunner;
import org.pdfsam.eventstudio.Annotations.ReflectiveMetadata;
import org.pdfsam.eventstudio.annotation.EventListener;
import org.pdfsam.eventstudio.exception.BroadcastInterruptionException;
import org.pdfsam.eventstudio.exception.EventStudioException;

        verify(mockListener).onEvent(event);
        verify(anotherMockListener).onEvent(event);
    }

    @Test
    public void annotatedAddAndBroadcast() throws IllegalAccessException, InvocationTargetException {
        Object event = new Object();
        TestPrioritizedAnnotatedBean bean = new TestPrioritizedAnnotatedBean();
        ReflectiveMetadata metadata = Annotations.process(bean);
        TestPrioritizedAnnotatedBean spy = spy(bean);
        victim.addAll(spy, metadata.getDescriptors().get(""));
        victim.broadcast(event);
        verify(spy).first(event);
        verify(spy).second(event);
    }

    @Test
    public void priority() {
        Object event = new Object();
        InOrder inOrder = Mockito.inOrder(anotherMockListener, mockListener);
        victim.add(mockListener, 0, ReferenceStrength.STRONG);
        victim.add(anotherMockListener, -1, ReferenceStrength.STRONG);
        victim.broadcast(event);
        inOrder.verify(anotherMockListener).onEvent(event);
        inOrder.verify(mockListener).onEvent(event);
    }

    @Test
    public void broadcastInterrupted() {
        Object event = new Object();
        doThrow(BroadcastInterruptionException.class).when(anotherMockListener).onEvent(any());