@Test
public void testDistinctOfNormalSourceWithKeySelectorAndComparator() {

    Observable<String> src = Observable.from("a", "x", "ab", "abc", "cba", "de", "x", "a", "abcd");
    Observable.create(distinct(src, TO_UPPER_WITH_EXCEPTION, COMPARE_LENGTH)).subscribe(w);
    InOrder inOrder = inOrder(w);
    inOrder.verify(w, times(1)).onNext("a");
    inOrder.verify(w, times(1)).onNext("x");
    inOrder.verify(w, times(1)).onNext("abc");
    inOrder.verify(w, times(1)).onNext("abcd");
    inOrder.verify(w, times(1)).onCompleted();
    inOrder.verify(w, never()).onNext(anyString());
    verify(w, never()).onError(any(Throwable.class));
}