@Test public void onEvent() { Event given = new Event(EventCode.UNDEFINED.value(), SESSION_ID, TRANSACTION_ID); set.onEvent(given); verify(listener1).onEvent(given); verify(listener2).onEvent(given); }
@Override public void onEvent(Event event) { Validators.notNull("event", event); for (Iterator<PtpEventListener> i = listeners.iterator(); i.hasNext(); ) { PtpEventListener listener = i.next(); try { listener.onEvent(event); } catch (RuntimeException e) { LOGGER.error("Unexpected exception in listener", e); i.remove(); } } }
PtpEventListenerSet extends AbstractSet<PtpEventListener> implements PtpEventListener { @Override public void onEvent(Event event) { Validators.notNull("event", event); for (Iterator<PtpEventListener> i = listeners.iterator(); i.hasNext(); ) { PtpEventListener listener = i.next(); try { listener.onEvent(event); } catch (RuntimeException e) { LOGGER.error("Unexpected exception in listener", e); i.remove(); } } } }
PtpEventListenerSet extends AbstractSet<PtpEventListener> implements PtpEventListener { @Override public void onEvent(Event event) { Validators.notNull("event", event); for (Iterator<PtpEventListener> i = listeners.iterator(); i.hasNext(); ) { PtpEventListener listener = i.next(); try { listener.onEvent(event); } catch (RuntimeException e) { LOGGER.error("Unexpected exception in listener", e); i.remove(); } } }  }
PtpEventListenerSet extends AbstractSet<PtpEventListener> implements PtpEventListener { @Override public void onEvent(Event event) { Validators.notNull("event", event); for (Iterator<PtpEventListener> i = listeners.iterator(); i.hasNext(); ) { PtpEventListener listener = i.next(); try { listener.onEvent(event); } catch (RuntimeException e) { LOGGER.error("Unexpected exception in listener", e); i.remove(); } } }  @Override boolean add(PtpEventListener listener); @Override boolean remove(Object o); @Override void clear(); @Override Iterator<PtpEventListener> iterator(); @Override int size(); @Override void onEvent(Event event); }
PtpEventListenerSet extends AbstractSet<PtpEventListener> implements PtpEventListener { @Override public void onEvent(Event event) { Validators.notNull("event", event); for (Iterator<PtpEventListener> i = listeners.iterator(); i.hasNext(); ) { PtpEventListener listener = i.next(); try { listener.onEvent(event); } catch (RuntimeException e) { LOGGER.error("Unexpected exception in listener", e); i.remove(); } } }  @Override boolean add(PtpEventListener listener); @Override boolean remove(Object o); @Override void clear(); @Override Iterator<PtpEventListener> iterator(); @Override int size(); @Override void onEvent(Event event);  }