ReviewAndSaveDeckPresenter { public void saveButtonClicked() { deckRepository.saveDeck(contextFromIntent.getDeck(), contextFromIntent.getDestinationLanguages()); view.finishAddDeckFlow(); } ReviewAndSaveDeckPresenter(ReviewAndSaveDeckView view, NewDeckContext contextFromIntent, DeckRepository deckRepository); void backButtonClicked(); void inflateBitmap(); void saveButtonClicked(); void initializeView();  }
@Test public void shouldSaveDeckWhenSaveButtonIsClicked() { HashSet<String> destinationLanguages = new HashSet<String>() {{ add(A_LANGUAGE); }}; Deck aDeck = mock(Deck.class); when(newDeckContext.getDeck()).thenReturn(aDeck); when(newDeckContext.getDestinationLanguages()).thenReturn(destinationLanguages); presenter.saveButtonClicked(); verify(deckRepository).saveDeck(aDeck, destinationLanguages); verify(view).finishAddDeckFlow(); }