@Test public void testPassThrough() throws Exception { final EventObserver observer = mock(EventObserver.class); final KingsHand kingsHand = new KingsHand(observer); verifyZeroInteractions(observer); for (final Event event : Event.values()) { kingsHand.onEvent(event); verify(observer, times(1)).onEvent(eq(event)); verifyNoMoreInteractions(observer); } }
@Override public void onEvent(Event e) { notifyObservers(e); }
KingsHand extends EventEmitter implements EventObserver { @Override public void onEvent(Event e) { notifyObservers(e); } }
KingsHand extends EventEmitter implements EventObserver { @Override public void onEvent(Event e) { notifyObservers(e); } KingsHand();  KingsHand(EventObserver obs); }
KingsHand extends EventEmitter implements EventObserver { @Override public void onEvent(Event e) { notifyObservers(e); } KingsHand();  KingsHand(EventObserver obs); @Override void onEvent(Event e); @Override void timePasses(Weekday day); }
KingsHand extends EventEmitter implements EventObserver { @Override public void onEvent(Event e) { notifyObservers(e); } KingsHand();  KingsHand(EventObserver obs); @Override void onEvent(Event e); @Override void timePasses(Weekday day);  }