Emitter { public void off(String event, Callback callback) { logger.debug("Removed callback for event {}", event); getEvents(event).remove(callback); }  void on(String event, Callback callback); void off(String event, Callback callback); void off(String event); void trigger(String name, Event arg); boolean hasCallbacks(String name);  }
@Test public void testOff() { Emitter.Callback cb = new Emitter.Callback() { @Override public void run(Event event) { assertTrue(true); } }; emitter.on("assertTrue", cb); emitter.trigger("assertTrue", new AbstractEvent() { }); emitter.off("assertTrue", cb); assertFalse(emitter.hasCallbacks("assertTrue")); emitter.on("assertTrue", cb); emitter.off("assertTrue"); assertFalse(emitter.hasCallbacks("assertTrue")); }