### Question:
JSONUtil { public static String getJSON(Object obj) { ObjectMapper mapper = new ObjectMapper(); try { return mapper.writeValueAsString(obj); } catch (JsonProcessingException e) { return TVaultConstants.EMPTY_JSON; } }  static String getJSON(Object obj); static String getJSONasDefaultPrettyPrint(Object obj); static String getJSONasDefaultPrettyPrintFromString(String obj); static Object getObj(String jsonStr, Class<?> className);  }### Answer:
@Test public void test_getJSON() throws Exception { String expectedJsonStr = "{\"username\":\"testuser\",\"password\":\"testuser\"}"; UserLogin userLogin = new UserLogin("testuser", "testuser"); String json = JSONUtil.getJSON(userLogin); assertEquals(expectedJsonStr, json); }