MvpBasePresenter implements MvpPresenter<V> { @UiThread @Override public void attachView(V view) { viewRef = new WeakReference<V>(view); presenterDestroyed = false; }  @UiThread @Override void attachView(V view); @Deprecated @UiThread V getView(); @Deprecated @UiThread boolean isViewAttached(); @Deprecated @UiThread @Override void detachView(boolean retainInstance); @Override void detachView(); @Override void destroy();  }
@Test public void testAttachView() { MvpBasePresenter<MvpView> presenter = new MvpBasePresenter<>(); MvpView mvpView = new MvpView() { }; Assert.assertFalse(presenter.isViewAttached()); presenter.attachView(mvpView); Assert.assertTrue(presenter.isViewAttached()); }