@Test public void testOnEvent() { final KingJoffrey kingJoffrey = new KingJoffrey(); for (int i = 0; i < Event.values().length; ++i) { assertEquals(i, appender.getLogSize()); Event event = Event.values()[i]; kingJoffrey.onEvent(event); final String expectedMessage = "Received event from the King's Hand: " + event.toString(); assertEquals(expectedMessage, appender.getLastMessage()); assertEquals(i + 1, appender.getLogSize()); } }
@Override public void onEvent(Event e) { LOGGER.info("Received event from the King's Hand: {}", e.toString()); }
KingJoffrey implements EventObserver { @Override public void onEvent(Event e) { LOGGER.info("Received event from the King's Hand: {}", e.toString()); } }
KingJoffrey implements EventObserver { @Override public void onEvent(Event e) { LOGGER.info("Received event from the King's Hand: {}", e.toString()); }  }
KingJoffrey implements EventObserver { @Override public void onEvent(Event e) { LOGGER.info("Received event from the King's Hand: {}", e.toString()); }  @Override void onEvent(Event e); }
KingJoffrey implements EventObserver { @Override public void onEvent(Event e) { LOGGER.info("Received event from the King's Hand: {}", e.toString()); }  @Override void onEvent(Event e);  }