### Question:
PasswordCallback extends AbstractPromptCallback { public void setPassword(char[] password) { setValue(new String(password)); Arrays.fill(password, ' '); } @Keep  PasswordCallback(JSONObject jsonObject, int index); void setPassword(char[] password); @Override String getType();  }### Answer:
@Test public void basicTest() throws JSONException { JSONObject raw = new JSONObject("{\n" + " \"type\": \"PasswordCallback\",\n" + " \"output\": [\n" + " {\n" + " \"name\": \"prompt\",\n" + " \"value\": \"Password\"\n" + " }\n" + " ],\n" + " \"input\": [\n" + " {\n" + " \"name\": \"IDToken2\",\n" + " \"value\": \"\"\n" + " }\n" + " ],\n" + " \"_id\": 1\n" + " }"); PasswordCallback passwordCallback = new PasswordCallback(raw, 0); assertEquals("Password", passwordCallback.getPrompt()); passwordCallback.setPassword("tester".toCharArray()); assertEquals(((JSONObject)passwordCallback.getContentAsJson().getJSONArray("input").get(0)).getString("value"), "tester"); assertEquals(1, passwordCallback.get_id()); }