@Test public void testValueCount() { TestSubscriber<Integer> ts = TestSubscriber.create(); ts.onNext(1); ts.onNext(2); try { ts.assertValueCount(3); fail("Failed to report there were values!"); } catch (AssertionError ex) { // expected } }