@SuppressWarnings("unchecked")
@Test
public void testSimpleAsyncConcat() {

    Observer<String> observer = mock(Observer.class);
    TestObservable<String> o1 = new TestObservable<String>("one", "two", "three");
    TestObservable<String> o2 = new TestObservable<String>("four", "five", "six");
    Observable.concat(Observable.create(o1), Observable.create(o2)).subscribe(observer);
    try {
        // wait for async observables to complete
        o1.t.join();
        o2.t.join();
    } catch (Throwable e) {
        throw new RuntimeException("failed waiting on threads");
    }
    InOrder inOrder = inOrder(observer);
    inOrder.verify(observer, times(1)).onNext("one");
    inOrder.verify(observer, times(1)).onNext("two");
    inOrder.verify(observer, times(1)).onNext("three");
    inOrder.verify(observer, times(1)).onNext("four");
    inOrder.verify(observer, times(1)).onNext("five");
    inOrder.verify(observer, times(1)).onNext("six");
}