SelectAddressPresenter extends BasePresenter<SelectAddressContract.View> implements SelectAddressContract.Presenter { @Override public void selectAddress(int position) { if (addressEntityList != null && addressEntityList.size() > position) { if (isViewAttached()) { String action = getView().getAction(); Address addressEntity = addressEntityList.get(position); if (Constants.Action.ACTION_GET_ADDRESS.equals(action)) { getView().setResult(addressEntity); } else { CommonUtil.copyTextToClipboard(currentActivity(), addressEntity.getAddress()); } } } }  List<Address> getAddressEntityList(); void setAddressEntityList(List<Address> addressEntityList); @Override void fetchAddressList(); @Override void selectAddress(int position);  }
@Test public void selectAddress(){ List<Address> addressEntityList = new ArrayList<>(); Address address = new Address(); address.setAddress("0x15asd35f5ad5fa34s5df4as53"); address.setAvatar("avatar-1"); address.setName("Ella"); address.setUuid(UUID.randomUUID().toString()); addressEntityList.add(address); presenter.setAddressEntityList(addressEntityList); }