@Test
public void correctItems() {

  Subscription subscription = mock(Subscription.class);
  Answer<Void> onNext = new Answer<Void>() {
    public Void answer(InvocationOnMock invocation) throws Throwable {
      for (JsonToken token: SAMPLE_TOKENS) {
        processor.onNext(token);
      }
      return null;
    }
  };
  doAnswer(onNext).when(subscription).request(Long.MAX_VALUE);
  processor.onSubscribe(subscription);
  
  Subscriber<String> subscriber = mock(Subscriber.class);
  VoidAnswer requestAll = invocation -> invocation.<Subscription>getArgument(0).request(Long.MAX_VALUE);
  doAnswer(requestAll).when(subscriber).onSubscribe(any());
  processor.subscribe(subscriber);
  ArgumentCaptor<String> values = ArgumentCaptor.forClass(String.class);
  verify(subscriber).onSubscribe(any());
  verify(subscriber, times(13)).onNext(values.capture());
  assertThat(values.getAllValues()).containsExactly(
      SAMPLE_TRIMMED_JSON_OBJECT,
      "{}",
      "[1,2,3]",
      "[]",
      "\"Json String\"",
      "0",
      "42",
      "-11",
      "3.141",
      "3e141",
      "true",
      "false",
      "null");
}