@Test(expected=UnsupportedOperationException.class) public void testCantModifyPayload() { List<String> l = new ArrayList<String>(); l.add("homer"); l.add("marge"); Object source = new Object(); TestEvent<Object,String> e = new TestEvent<Object,String>(source,Object.class,l); Collection<String> payload = e.getPayloadCollection(); payload.add("something"); }
@Override public Collection<P> getPayloadCollection() { return payload; }
AbstractCyPayloadEvent extends AbstractCyEvent<T> implements CyPayloadEvent<T,P> { @Override public Collection<P> getPayloadCollection() { return payload; } }
AbstractCyPayloadEvent extends AbstractCyEvent<T> implements CyPayloadEvent<T,P> { @Override public Collection<P> getPayloadCollection() { return payload; } AbstractCyPayloadEvent(final T source, Class<?> listenerClass, Collection<P> payload); }
AbstractCyPayloadEvent extends AbstractCyEvent<T> implements CyPayloadEvent<T,P> { @Override public Collection<P> getPayloadCollection() { return payload; } AbstractCyPayloadEvent(final T source, Class<?> listenerClass, Collection<P> payload); @Override Collection<P> getPayloadCollection(); }
AbstractCyPayloadEvent extends AbstractCyEvent<T> implements CyPayloadEvent<T,P> { @Override public Collection<P> getPayloadCollection() { return payload; } AbstractCyPayloadEvent(final T source, Class<?> listenerClass, Collection<P> payload); @Override Collection<P> getPayloadCollection();  }