VisumPresenter { public final int getViewCount() { return viewHolders.size(); }  final void setView(int id, @Nullable V view); void onStop(); void onStart(); final Subscription subscribe(int viewId, Observable<T> observable, Observer<? super T> observer); final Subscription subscribe(int viewId, Observable<T> observable, Action1<T> action, Action1<Throwable> error); final Subscription subscribe(Observable<T> observable, @NonNull final ViewNotifier<V, T> viewNotifier); final Subscription subscribe(int viewId, Single<T> single, SingleSubscriber<T> subscriber); final Subscription subscribe(int viewId, Single<T> single, Action1<T> action, Action1<Throwable> error); @SuppressWarnings("unused") final Subscription subscribe(Single<T> single, @NonNull final ViewNotifier<V, T> viewNotifier); final Subscription subscribe(int viewId, Completable completable, Action0 onComplete, Action1<? super Throwable> onError); void unsubscribe(Subscription... subscriptions); @NonNull final V view(int id); @SuppressWarnings({"unused"}) final void forEachView(@NonNull Action1<V> action1); final int getViewCount(); final boolean hasViews(); final boolean hasSubscriptions(); final boolean hasSubscriptions(int viewId);  }
@Test public void testMultiViews() { BaseTestView viewOne = getClient(); viewOne.attachPresenter(); assertPresenterAttached(presenter, VIEW_ID, viewOne); viewTwo.attachPresenter(); assertPresenterAttached(presenter, VIEW_ID_TWO, viewTwo); Assert.assertEquals("Invalid view count", 2, presenter.getViewCount()); viewOne.detachPresenter(); assertPresenterDetached(presenter, VIEW_ID, viewOne); viewTwo.detachPresenter(); assertPresenterDetached(presenter, VIEW_ID_TWO, viewTwo); }