MvpBasePresenter implements MvpPresenter<V> { @Deprecated @UiThread public V getView() { return viewRef == null ? null : viewRef.get(); }  @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 testGetView() { MvpBasePresenter<MvpView> presenter = new MvpBasePresenter<>(); MvpView mvpView = new MvpView() { }; Assert.assertNull(presenter.getView()); presenter.attachView(mvpView); Assert.assertNotNull(presenter.getView()); }