Payload { public <T> T getMessage( Class<T> clazz ) { if ( !StringUtils.isBlank( request ) ) { return JsonUtil.fromJsonString( request, clazz ); } return null; } Payload( final Object request, String sourcePeerId ); T getMessage( Class<T> clazz ); String getSourcePeerId();  }
@Test public void testGetMessage() throws Exception { Request request2 = payload.getMessage( Request.class ); assertEquals( request, request2 ); }