SingleInteractor implements Interactor<DisposableSingleObserver, P> { @SuppressWarnings("unchecked") @Override public void execute(DisposableSingleObserver observer, P params) { DisposableSingleObserver disposableObserver = buildReactiveStream(params) .subscribeOn(Schedulers.from(threadExecutor)) .observeOn(postExecutionThread.getScheduler()) .subscribeWith(observer); disposables.add(disposableObserver); } SingleInteractor(ThreadExecutor threadExecutor, PostExecutionThread postExecutionThread); @SuppressWarnings("unchecked") @Override void execute(DisposableSingleObserver observer, P params); @Override void dispose();  }
@Test(expected = NullPointerException.class) public void shouldFailWhenNullObserver() throws Exception { singleInteractor.execute(null, null); }