### Question:
MainActivity extends RoboActivity { public void coinToss(View view){ setWhoGoesFirst(coinTossHelper.coinToss()); }  void setNumberOfPlayers(View view); void coinToss(View view); void newGame(View view);  }### Answer:
@Test public void shouldSetTurnOnCoinTossX(){ when(coinTossHelper.coinToss()).thenReturn(GameSymbol.X); Button button = Mockito.mock(Button.class); activity.coinToss(button); verify(toeGame, times(2)).setTurn(eq(GameSymbol.X)); }
@Test public void shouldSetMessageOnCoinTossX(){ when(coinTossHelper.coinToss()).thenReturn(GameSymbol.X); Button button = Mockito.mock(Button.class); activity.coinToss(button); assertEquals("X goes first", activity.turnDisplay.getText()); }
@Test public void shouldSetTurnOnCoinTossO(){ when(coinTossHelper.coinToss()).thenReturn(GameSymbol.O); Button button = Mockito.mock(Button.class); activity.coinToss(button); verify(toeGame).setTurn(eq(GameSymbol.O)); }
@Test public void shouldSetMessageOnCoinTossO(){ when(coinTossHelper.coinToss()).thenReturn(GameSymbol.O); Button button = Mockito.mock(Button.class); activity.coinToss(button); assertEquals("O goes first", activity.turnDisplay.getText()); }