diff --git a/rxjava-core/src/test/java/rx/ObservableTests.java b/rxjava-core/src/test/java/rx/ObservableTests.java index 1710f16d18..3919ab6c9d 100644 --- a/rxjava-core/src/test/java/rx/ObservableTests.java +++ b/rxjava-core/src/test/java/rx/ObservableTests.java @@ -755,6 +755,20 @@ public void testContains() { verify(aObserver, times(1)).onCompleted(); } + @Test + public void testContainsWithInexistence() { + Observable observable = Observable.from("a", "b", null).contains("c"); + + @SuppressWarnings("unchecked") + Observer aObserver = mock(Observer.class); + observable.subscribe(aObserver); + verify(aObserver, times(1)).onNext(false); + verify(aObserver, never()).onNext(true); + verify(aObserver, never()).onError( + org.mockito.Matchers.any(Throwable.class)); + verify(aObserver, times(1)).onCompleted(); + } + @Test public void testContainsWithNull() { Observable observable = Observable.from("a", "b", null).contains(null);