### Question:
ChoiceCallback extends AbstractPromptCallback { public void setSelectedIndex(int selection) { setValue(selection); } @Keep  ChoiceCallback(JSONObject jsonObject, int index); void setSelectedIndex(int selection); @Override String getType();  }### Answer:
@Test public void basicTest() throws JSONException { JSONObject raw = new JSONObject("{\n" + " \"type\": \"ChoiceCallback\",\n" + " \"output\": [\n" + " {\n" + " \"name\": \"prompt\",\n" + " \"value\": \"Second Factor\"\n" + " },\n" + " {\n" + " \"name\": \"choices\",\n" + " \"value\": [\n" + " \"email\",\n" + " \"sms\"\n" + " ]\n" + " },\n" + " {\n" + " \"name\": \"defaultChoice\",\n" + " \"value\": 0\n" + " }\n" + " ],\n" + " \"input\": [\n" + " {\n" + " \"name\": \"IDToken1\",\n" + " \"value\": 0\n" + " }\n" + " ]\n" + " }"); ChoiceCallback choiceCallback = new ChoiceCallback(raw, 0); assertEquals("Second Factor", choiceCallback.getPrompt()); choiceCallback.setSelectedIndex(1); assertEquals(1, ((JSONObject)choiceCallback.getContentAsJson().getJSONArray("input").get(0)).getInt("value")); }