@Test public void testGetObjectReturnsCorrectResult() { StartStreamCommand cmd = new StartStreamCommand("12345", Arrays.asList("hello")); StartStreamCommand result = testObj.getObject(JSON_TEXT, StartStreamCommand.class); assertEquals(cmd, result); }
public <T extends Serializable> T getObject(String json, Class<T> clazz) { T result; try { result = objectMapper.readValue(json, clazz); } catch (IOException e) { throw new RuntimeException(e); } return result; }
JsonMessageSerializer { public <T extends Serializable> T getObject(String json, Class<T> clazz) { T result; try { result = objectMapper.readValue(json, clazz); } catch (IOException e) { throw new RuntimeException(e); } return result; } }
JsonMessageSerializer { public <T extends Serializable> T getObject(String json, Class<T> clazz) { T result; try { result = objectMapper.readValue(json, clazz); } catch (IOException e) { throw new RuntimeException(e); } return result; }  }
JsonMessageSerializer { public <T extends Serializable> T getObject(String json, Class<T> clazz) { T result; try { result = objectMapper.readValue(json, clazz); } catch (IOException e) { throw new RuntimeException(e); } return result; }  String getJson(Serializable obj); T getObject(String json, Class<T> clazz); }
JsonMessageSerializer { public <T extends Serializable> T getObject(String json, Class<T> clazz) { T result; try { result = objectMapper.readValue(json, clazz); } catch (IOException e) { throw new RuntimeException(e); } return result; }  String getJson(Serializable obj); T getObject(String json, Class<T> clazz);  }