GenericEvent extends Event { public S getSource() { return (S) super.getSource(); } GenericEvent(S source); S getSource();  }
@Test public void test() { long timestamp = System.currentTimeMillis(); GenericEvent<String> event = new GenericEvent("Hello,World"); assertEquals("Hello,World", event.getSource()); assertTrue(event.getTimestamp() >= timestamp); }