MainPresenter { public void onSaveButtonClick(String note) { if (note.isEmpty()) { return; } mModel.addNoteToList(note); mView.clearNoteEditText(); mView.updateRecyclerView(mModel.getNoteList()); } MainPresenter(MainView view, MainModel model); void onCreate(); void onSaveButtonClick(String note); void onDeleteButtonClick(int position);  }
@Test public void testOnSaveButtonClick_withTextInput() throws Exception { String note = "note"; presenter.onSaveButtonClick(note); verify(model).addNoteToList(note); verify(view).clearNoteEditText(); verify(view).updateRecyclerView(model.getNoteList()); }
@Test public void testOnSaveButtonClick_noTextInput() throws Exception { String note = ""; presenter.onSaveButtonClick(note); verify(model, never()).addNoteToList(note); verify(view, never()).clearNoteEditText(); verify(view, never()).updateRecyclerView(model.getNoteList()); }