### Question:
MainActivity extends RoboActivity { public void setNumberOfPlayers(View view){ setPlayers(R.id.gameplay_one_player == view.getId()); }  void setNumberOfPlayers(View view); void coinToss(View view); void newGame(View view);  }### Answer:
@Test public void shouldSetNumberOfPlayersToOne(){ RadioButton mockButton = Mockito.mock(RadioButton.class); when(mockButton.getId()).thenReturn(R.id.gameplay_one_player); when(mockButton.isChecked()).thenReturn(true); activity.setNumberOfPlayers(mockButton); verify(toeGame, times(1)).setNumOfPlayers(1); }
@Test public void shouldSetNumberOfPlayersToTwo(){ RadioButton mockButton = Mockito.mock(RadioButton.class); when(mockButton.getId()).thenReturn(R.id.gameplay_two_player); when(mockButton.isChecked()).thenReturn(true); activity.setNumberOfPlayers(mockButton); verify(toeGame, times(2)).setNumOfPlayers(2); }