### Question:
AbstractRestAuthCallbackHandler implements RestAuthCallbackHandler<T> { final Object createOutputField(String name, Object value) { return createJsonField(name, value).getObject(); }  boolean updateCallbackFromRequest(HttpServletRequest request, HttpServletResponse response, T callback);  }### Answer:
@Test public void shouldCreateJsonOutputField() throws JSONException { String name = "NAME"; String value = "VALUE"; JsonValue jsonObject = json(abstractRestAuthCallbackHandler.createOutputField(name, value)); assertEquals(jsonObject.get("name").asString(), "NAME"); assertEquals(jsonObject.get("value").asString(), "VALUE"); }
@Test public void shouldCreateJsonOutputFieldWithObjectArray() throws JSONException { String name = "NAME"; String[] values = new String[]{"VALUE1", "VALUE2", "VALUE3"}; JsonValue jsonObject = json(abstractRestAuthCallbackHandler.createOutputField(name, values)); assertEquals(jsonObject.get("name").asString(), "NAME"); assertEquals(jsonObject.get("value").get(0).asString(), "VALUE1"); assertEquals(jsonObject.get("value").get(1).asString(), "VALUE2"); assertEquals(jsonObject.get("value").get(2).asString(), "VALUE3"); }