@Test public void testAdd() throws Exception { RxPresenter presenter = new RxPresenter(); Subscription mock = Mockito.mock(Subscription.class); when(mock.isUnsubscribed()).thenReturn(false); presenter.add(mock); presenter.onDestroy(); verify(mock, times(1)).unsubscribe(); verify(mock, atLeastOnce()).isUnsubscribed(); verifyNoMoreInteractions(mock); }
public void add(Subscription subscription) { subscriptions.add(subscription); }
RxPresenter extends Presenter<View> { public void add(Subscription subscription) { subscriptions.add(subscription); } }
RxPresenter extends Presenter<View> { public void add(Subscription subscription) { subscriptions.add(subscription); }  }
RxPresenter extends Presenter<View> { public void add(Subscription subscription) { subscriptions.add(subscription); }  Observable<View> view(); void add(Subscription subscription); void remove(Subscription subscription); void restartable(int restartableId, Func0<Subscription> factory); void restartable(int restartableId, Func4<T1, T2, T3, T4, Subscription> factory); void start(int restartableId); void start(int restartableId, T1 arg1, T2 arg2, T3 arg3, T4 arg4); void stop(int restartableId); void restartableFirst(int restartableId, final Func0<Observable<T>> observableFactory,
                                     final Action2<View, T> onNext, @Nullable final Action2<View, Throwable> onError); void restartableFirst(int restartableId,
                                                     final Func4<T1, T2, T3, T4, Observable<T>> observableFactory,
                                                     final Action2<View, T> onNext,
                                                     @Nullable final Action2<View, Throwable> onError); void restartableFirst(int restartableId, final Func0<Observable<T>> observableFactory, final Action2<View, T> onNext); void restartableLatestCache(int restartableId, final Func0<Observable<T>> observableFactory,
                                           final Action2<View, T> onNext, @Nullable final Action2<View, Throwable> onError); void restartableLatestCache(int restartableId, final Func0<Observable<T>> observableFactory, final Action2<View, T> onNext); void restartableReplay(int restartableId, final Func0<Observable<T>> observableFactory,
                                      final Action2<View, T> onNext, @Nullable final Action2<View, Throwable> onError); void restartableReplay(int restartableId, final Func0<Observable<T>> observableFactory, final Action2<View, T> onNext); DeliverLatestCache<View, T> deliverLatestCache(); DeliverFirst<View, T> deliverFirst(); DeliverReplay<View, T> deliverReplay(); Action1<Delivery<View, T>> split(final Action2<View, T> onNext, @Nullable final Action2<View, Throwable> onError); Action1<Delivery<View, T>> split(Action2<View, T> onNext); Observable<Delivery<View, T>> afterTakeViewDeliverLastestCache(); Observable<View> afterTakeView(); @Override void restore(); @Deprecated @Nullable @Override View getView(); }
RxPresenter extends Presenter<View> { public void add(Subscription subscription) { subscriptions.add(subscription); }  Observable<View> view(); void add(Subscription subscription); void remove(Subscription subscription); void restartable(int restartableId, Func0<Subscription> factory); void restartable(int restartableId, Func4<T1, T2, T3, T4, Subscription> factory); void start(int restartableId); void start(int restartableId, T1 arg1, T2 arg2, T3 arg3, T4 arg4); void stop(int restartableId); void restartableFirst(int restartableId, final Func0<Observable<T>> observableFactory,
                                     final Action2<View, T> onNext, @Nullable final Action2<View, Throwable> onError); void restartableFirst(int restartableId,
                                                     final Func4<T1, T2, T3, T4, Observable<T>> observableFactory,
                                                     final Action2<View, T> onNext,
                                                     @Nullable final Action2<View, Throwable> onError); void restartableFirst(int restartableId, final Func0<Observable<T>> observableFactory, final Action2<View, T> onNext); void restartableLatestCache(int restartableId, final Func0<Observable<T>> observableFactory,
                                           final Action2<View, T> onNext, @Nullable final Action2<View, Throwable> onError); void restartableLatestCache(int restartableId, final Func0<Observable<T>> observableFactory, final Action2<View, T> onNext); void restartableReplay(int restartableId, final Func0<Observable<T>> observableFactory,
                                      final Action2<View, T> onNext, @Nullable final Action2<View, Throwable> onError); void restartableReplay(int restartableId, final Func0<Observable<T>> observableFactory, final Action2<View, T> onNext); DeliverLatestCache<View, T> deliverLatestCache(); DeliverFirst<View, T> deliverFirst(); DeliverReplay<View, T> deliverReplay(); Action1<Delivery<View, T>> split(final Action2<View, T> onNext, @Nullable final Action2<View, Throwable> onError); Action1<Delivery<View, T>> split(Action2<View, T> onNext); Observable<Delivery<View, T>> afterTakeViewDeliverLastestCache(); Observable<View> afterTakeView(); @Override void restore(); @Deprecated @Nullable @Override View getView();  }