GenericMessage extends BaseMessage<T> { @Override protected Message<T> withMetaData(MetaData metaData) { return new GenericMessage<>(this, metaData); } GenericMessage(T payload);  GenericMessage(String id, T payload);  GenericMessage(T payload, Map<String, ?> metaData);  GenericMessage(String id, T payload, Map<String, ?> metaData);  GenericMessage(GenericMessage<T> original, MetaData metaData); @Override MetaData getMetaData(); @Override T getPayload(); @Override Class<T> getPayloadType();  }
@Test public void test_genericMessage() throws Exception { GenericMessage<Object> message1 = new GenericMessage<>(new Object()); GenericMessage<Integer> message2 = new GenericMessage<>(1234); GenericMessage<String> message3 = new GenericMessage<>("asdf"); Message<String> message4 = message3.withMetaData(MetaData.with("foo", "bar")); }