@Test
public void onCompletedIsNotSentAfterOnError() {

    final RateLimitedBatcher<BatchableOperationMock, String> batcher = buildBatcher(minimumTimeInQueueMs);
    final Subject<BatchableOperationMock, BatchableOperationMock> updates = PublishSubject.<BatchableOperationMock>create().toSerialized();
    final AssertableSubscriber<Batch<BatchableOperationMock, String>> subscriber = updates.lift(batcher).test();
    testScheduler.triggerActions();
    subscriber.assertNoTerminalEvent().assertNoValues();
    updates.onError(new RuntimeException("some problem"));
    testScheduler.triggerActions(); // onError is forwarded right away (i.e.: don't wait for the next flush event)
    subscriber.assertNotCompleted().assertError(RuntimeException.class);
    updates.onCompleted();
    subscriber.assertNotCompleted();
}