LoginPresenter extends BasePresenter<LoginPresenter.ViewContract> implements Bundleable { @Override public Bundle toBundle() { Bundle bundle = BundleFactory.create(); bundle.putString("username", username); bundle.putString("password", password); return bundle; } @Inject  LoginPresenter(); void updateUsername(String username); void updatePassword(String password); void login(); @Override Bundle toBundle(); @Override void fromBundle(@Nullable Bundle bundle);  }
@Test public void toBundle() throws Exception { loginPresenter.username = "Hello"; loginPresenter.password = "World"; Bundle bundle = loginPresenter.toBundle(); Mockito.verify(bundle).putString("username", "Hello"); Mockito.verify(bundle).putString("password", "World"); Mockito.verifyNoMoreInteractions(bundle); }