### Question:
EventManager { public <T extends EventData> void addListener (int typeID, EventListener<T> listener) { Objects.requireNonNull(listener); Array<EventListener> list = this.listenerMap.get(typeID); if (list == null) { list = new Array<>(10); this.listenerMap.put(typeID, list); } if (list.contains(listener, false)) { throw new IllegalStateException("listener for typeID '" + typeID + "' and hash " + listener + " is already registered."); } list.add(listener); } EventManager(String name, boolean setAsGlobal); void update(); void update(int maxMillis); void queueEvent(EventData event); void triggerEvent(EventData event); void addListener(int typeID, EventListener<T> listener); void removeListener(int typeID, EventListener<T> listener); static final EventManager getInstance();  }### Answer:
@Test (expected = NullPointerException.class) public void testAddNullListener () { EventManager manager = new EventManager("test", false); manager.addListener(1, null); }
@Test public void testAddListener () { EventManager manager = new EventManager("test", false); manager.addListener(1, eventData -> { }); }
@Test public void testAddSameListener () { EventManager manager = new EventManager("test", false); manager.addListener(1, eventData -> { }); }
@Test (expected = IllegalStateException.class) public void testRemoveNotExistentListener () { EventManager manager = new EventManager("test", false); EventListener listener = (eventData -> { }); manager.addListener(2, listener); manager.addListener(2, listener); }