title: Test own Mutiny operator
body: <p>I am new to reactive Programming and created my first own Mutiny operator like described in <a href="https://smallrye.io/smallrye-mutiny/guides/plug" rel="nofollow noreferrer">https://smallrye.io/smallrye-mutiny/guides/plug</a>.</p>
  <p>My operator is a collector, which collect x items in list and send the items if x is reached or when the stream is completed.</p>
  <pre><code>public class ListCollectorUntil&lt;T&gt; extends AbstractMultiOperator&lt;T, List&lt;T&gt;&gt; {
  
  ListCollectorUntil(Multi&lt;? extends T&gt; upstream) {
      super(upstream);
  }
  
  public ListCollectorUntil(Multi&lt;? extends T&gt; upstream, int count) {
      this(upstream);
      this.count = count;
  }
  
  private int count;
  private final List&lt;T&gt; bufferList = new ArrayList&lt;&gt;();
  private final List&lt;T&gt; tempBufferList = new ArrayList&lt;&gt;();
  
  @Override
  public void subscribe(MultiSubscriber&lt;? super List&lt;T&gt;&gt; downstream) {
      upstream.subscribe().withSubscriber(new ListCollectorProcessor(downstream));
  }
  
  private class ListCollectorProcessor extends MultiOperatorProcessor&lt;T, List&lt;T&gt;&gt; {
  
      public ListCollectorProcessor(MultiSubscriber&lt;? super List&lt;T&gt;&gt; downstream) {
          super(downstream);
      }
  
      @Override
      public void onItem(T item) {
          bufferList.add(item);
          if (bufferList.size() &gt;= count) {
              this.downstream.onItem(getUni());
          }
      }
  
      @Override
      public void onCompletion() {
          Subscription subscription = this.upstream.getAndSet(Subscriptions.CANCELLED);
          if (subscription != Subscriptions.CANCELLED) {
              this.downstream.onItem(getUni());
              this.downstream.onCompletion();
          }
      }
  
      private List&lt;T&gt; getUni() {
          tempBufferList.clear();
          tempBufferList.addAll(bufferList);
          bufferList.clear();
          return tempBufferList;
      }
  }
  </code></pre>
  <p>When I started testing it with the following code:</p>
  <pre><code>void buffer_after5Inputs_uniShouldBeReturned() {
      Multi&lt;List&lt;Integer&gt;&gt; multi = Multi.createFrom().items(1, 2, 3, 4, 5, 6)
              .plug( integerMulti -&gt; new Buffer&lt;&gt;(integerMulti, 4));
      multi.subscribe().with(
              integerList -&gt; System.out.println(integerList),
              failur -&gt; System.out.println(failur),
              () -&gt; System.out.println(&quot;completed&quot;)
      );
      AssertSubscriber&lt;List&lt;Integer&gt;&gt; assertSubscriber =
              multi.subscribe().withSubscriber(AssertSubscriber.create(2))
                      .assertCompleted()
              .assertItems(Arrays.asList(1, 2, 3, 4), Arrays.asList(5, 6));
  }
  </code></pre>
  <p>FROM my first subscriber I get:
  [1, 2, 3, 4]
  [5, 6]
  completed
  But the Assertsubscriber seams to get no events, neither onItem nor onCompleted
  Did I make a mistake somewhere?</p>