### Question:
QuestionPresenter implements QuestionFragmentContract.Presenter { @Override public void onAnswerSelected(int id) { List<QuestionsContract> questions = this.listOfQuestions.getQuestion(); QuestionsContract questionsContract = questions.get(position); int selectedColor = questionsContract.getColor(); int unselectedColor = R.color.colorPrimary; String answer = null; switch (id) { case R.id.answer_yes: view.setBackgroundColor(selectedColor, unselectedColor, unselectedColor); answer = "yes"; break; case R.id.answer_no: view.setBackgroundColor(unselectedColor, selectedColor, unselectedColor); answer = "no"; break; case R.id.answer_unsure: view.setBackgroundColor(unselectedColor, unselectedColor, selectedColor); answer = "unsure"; break; default: break; } String answerTag = questionsContract.getAnswer(answer); String questionTag = questionsContract.getTag(); addAnswer(questionTag, answerTag); if (position == listOfQuestions.getNoOfQuestions() - 1) { view.createChangesetTags(); new Thread(new Runnable() { @Override public void run() { SourceContract.upload upload = new UploadToOSM(preferences); upload.uploadToOsm(); } }).start(); } } QuestionPresenter(QuestionFragmentContract.View view, int position, SourceContract.Preferences preferences); @Override void getQuestion(); @Override void onAnswerSelected(int id);  }### Answer:
@Test public void yesAnswerSelected() { questionPresenter.onAnswerSelected(R.id.answer_yes); verify(view).setBackgroundColor(anyInt(), anyInt(), anyInt()); }
@Test public void noAnswerSelected() { questionPresenter.onAnswerSelected(R.id.answer_no); verify(view).setBackgroundColor(anyInt(), anyInt(), anyInt()); }
@Test public void unsureAnswerSelected() { questionPresenter.onAnswerSelected(R.id.answer_unsure); Set<String> keySet = Answers.getAnswerMap().keySet(); String key = keySet.toArray(new String[keySet.size()])[0]; String actual_answer = Answers.getAnswerMap().get(key); String expected_answer = ""; verify(view).setBackgroundColor(anyInt(), anyInt(), anyInt()); assertEquals(expected_answer, actual_answer); }