BasePresenter implements Presenter { @Override public void onStop() { compositeSubscription.clear(); } BasePresenter(); @Override void onStop();  }
@Test public void testOnStop() throws Exception { Subscription test = new TestSubscriber<>(); basePresenter.addSubscription(test); basePresenter.onStop(); assertTrue(test.isUnsubscribed()); }