@Test
public void testDistinctUntilChangedOfSourceWithExceptionsFromKeySelector() {

    Observable<String> src = Observable.from("a", "b", null, "c");
    Observable.create(distinctUntilChanged(src, TO_UPPER_WITH_EXCEPTION)).subscribe(w);
    InOrder inOrder = inOrder(w);
    inOrder.verify(w, times(1)).onNext("a");
    inOrder.verify(w, times(1)).onNext("b");
    verify(w, times(1)).onError(any(NullPointerException.class));
    inOrder.verify(w, never()).onNext(anyString());
    inOrder.verify(w, never()).onCompleted();
}