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