VerificationMnemonicPresenter extends BasePresenter<VerificationMnemonicContract.View> implements VerificationMnemonicContract.Presenter { @Override public void checkBottomListItem(int index) { VerificationMnemonicContract.DataEntity dataEntity = mAllList.get(index); if (dataEntity.isChecked()) { dataEntity.setChecked(false); removeTopItem(dataEntity); } else { dataEntity.setChecked(true); addTopItem(dataEntity); } getView().showTopList(mTopList); getView().showBottomList(mAllList); getView().setCompletedBtnEnable(enableBackup()); getView().setClearBtnEnable(enableClear()); }  VerificationMnemonicContract.DataEntity[] getmTopList(); void setmTopList(VerificationMnemonicContract.DataEntity[] mTopList); ArrayList<VerificationMnemonicContract.DataEntity> getmAllList(); void setmAllList(ArrayList<VerificationMnemonicContract.DataEntity> mAllList); @Override void init(); @Override void checkTopListItem(int index); @Override void checkBottomListItem(int index); @Override void emptyChecked(); @Override void submit(); VerificationMnemonicContract.DataEntity generateDataEntity(String mnemonic);  }
@Test public void checkBottomListItem(){ ArrayList<VerificationMnemonicContract.DataEntity> mAllList = new ArrayList<>(); String mMnemonic = "year rib clay employ boring icon vote shrug lab fluid loyal panda"; String[] worlds = mMnemonic.split(" "); VerificationMnemonicContract.DataEntity[] mTopList = new VerificationMnemonicContract.DataEntity[worlds.length]; presenter.setmTopList(mTopList); for (String world : worlds) { VerificationMnemonicContract.DataEntity dataEntity = presenter.generateDataEntity(world); mAllList.add(dataEntity); } presenter.setmAllList(mAllList); presenter.checkBottomListItem(0); Mockito.verify(view).showBottomList(Mockito.any()); }