@Test
@SuppressWarnings("unchecked")
public void testSimple() throws InterruptedException {

    final ExecutorService exec = Executors.newCachedThreadPool();
    try {
        final CountDownLatch ready = new CountDownLatch(1);
        Func0<Future<Integer>> func = new Func0<Future<Integer>>() {
            @Override
            public Future<Integer> call() {
                return exec.submit(new Callable<Integer>() {
                    @Override
                    public Integer call() throws Exception {
                        if (!ready.await(1000, TimeUnit.MILLISECONDS)) {
                            throw new IllegalStateException("Not started in time");
                        }
                        return 1;
                    }
                });
            }
        };
        Observable<Integer> result = Async.startFuture(func, Schedulers.threadPoolForComputation());
        final Observer<Integer> observer = mock(Observer.class);
        final CountDownLatch done = new CountDownLatch(1);
        result.subscribe(new MockHelper<Integer>(observer, done));
        ready.countDown();
        if (!done.await(1000, TimeUnit.MILLISECONDS)) {
            fail("Not completed in time!");
        }
        InOrder inOrder = inOrder(observer);
        inOrder.verify(observer).onNext(1);
        inOrder.verify(observer).onCompleted();
        verify(observer, never()).onError(any(Throwable.class));
    } finally {        
        exec.shutdown();
    }
}