### Question:
ConfirmationCallback extends AbstractPromptCallback { public void setSelectedIndex(int selection) { selectedIndex = selection; setValue(selection); } @Keep  ConfirmationCallback(JSONObject jsonObject, int index); void setSelectedIndex(int selection); @Override String getType(); static final int UNSPECIFIED_OPTION; static final int YES_NO_OPTION; static final int YES_NO_CANCEL_OPTION; static final int OK_CANCEL_OPTION; static final int YES; static final int NO; static final int CANCEL; static final int OK; static final int INFORMATION; static final int WARNING; static final int ERROR; }### Answer:
@Test public void basicTest() throws JSONException { JSONObject raw = new JSONObject("{\n" + " \"type\": \"ConfirmationCallback\",\n" + " \"output\": [\n" + " {\n" + " \"name\": \"prompt\",\n" + " \"value\": \"\"\n" + " },\n" + " {\n" + " \"name\": \"messageType\",\n" + " \"value\": 0\n" + " },\n" + " {\n" + " \"name\": \"options\",\n" + " \"value\": [\n" + " \"I can't wait, please let me go.\"\n" + " ]\n" + " },\n" + " {\n" + " \"name\": \"optionType\",\n" + " \"value\": -1\n" + " },\n" + " {\n" + " \"name\": \"defaultOption\",\n" + " \"value\": 0\n" + " }\n" + " ],\n" + " \"input\": [\n" + " {\n" + " \"name\": \"IDToken2\",\n" + " \"value\": 100\n" + " }\n" + " ]\n" + " }"); ConfirmationCallback confirmationCallback = new ConfirmationCallback(raw, 0); assertEquals("", confirmationCallback.getPrompt()); assertEquals(ConfirmationCallback.INFORMATION, confirmationCallback.getMessageType()); assertEquals("I can't wait, please let me go.", confirmationCallback.getOptions().get(0)); assertEquals(ConfirmationCallback.UNSPECIFIED_OPTION, confirmationCallback.getOptionType()); assertEquals(ConfirmationCallback.YES, confirmationCallback.getDefaultOption()); confirmationCallback.setSelectedIndex(0); assertEquals(0, ((JSONObject)confirmationCallback.getContentAsJson().getJSONArray("input").get(0)).getInt("value")); }