### Question:
Publisher { public void off(Consumer<E> fn) { this.listeners.remove(fn); }  void on(Consumer<E> fn); void off(Consumer<E> fn); void post(E event);  }### Answer:
@Test public void off() throws Exception { String[] called = { "aaa" }; Consumer<String> fn = s -> called[0] = s; target.on(fn); target.off(fn); target.post("bbb"); assertEquals("aaa", called[0]); }