@Test public void showWord() throws Exception { VocabularyWord word = mock(VocabularyWord.class); presenter.onCreate(); presenter.onBind(view); presenter.showWord(Optional.of(word)); verify(view).showWord(word); }
public void showWord(Optional<VocabularyWord> word) { if (word.isPresent()) { applyState(view -> view.showWord(word.get())); } else { applyState(IVocabularyWordView::showEmpty); } }
VocabularyWordPresenter extends AbstractPresenter<IVocabularyWordView> { public void showWord(Optional<VocabularyWord> word) { if (word.isPresent()) { applyState(view -> view.showWord(word.get())); } else { applyState(IVocabularyWordView::showEmpty); } } }
VocabularyWordPresenter extends AbstractPresenter<IVocabularyWordView> { public void showWord(Optional<VocabularyWord> word) { if (word.isPresent()) { applyState(view -> view.showWord(word.get())); } else { applyState(IVocabularyWordView::showEmpty); } } @Inject  VocabularyWordPresenter(@Named(VIEW_EXECUTOR) Executor executor); }
VocabularyWordPresenter extends AbstractPresenter<IVocabularyWordView> { public void showWord(Optional<VocabularyWord> word) { if (word.isPresent()) { applyState(view -> view.showWord(word.get())); } else { applyState(IVocabularyWordView::showEmpty); } } @Inject  VocabularyWordPresenter(@Named(VIEW_EXECUTOR) Executor executor); void showWord(Optional<VocabularyWord> word); }
VocabularyWordPresenter extends AbstractPresenter<IVocabularyWordView> { public void showWord(Optional<VocabularyWord> word) { if (word.isPresent()) { applyState(view -> view.showWord(word.get())); } else { applyState(IVocabularyWordView::showEmpty); } } @Inject  VocabularyWordPresenter(@Named(VIEW_EXECUTOR) Executor executor); void showWord(Optional<VocabularyWord> word);  }