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