@Test(expected = IllegalArgumentException.class)
public void testExceptionWithMoreThanOneElement() throws Throwable {

    Observable<String> obs = Observable.just("one", "two");
    Future<String> f = toFuture(obs);
    try {
        // we expect an exception since there are more than 1 element
        f.get();
    }
    catch(ExecutionException e) {
        throw e.getCause();
    }
}