ForwardPartitioner extends StreamPartitioner<T> { @Override public int[] selectChannels(SerializationDelegate<StreamRecord<T>> record, int numberOfOutputChannels) { return returnArray; }  @Override int[] selectChannels(SerializationDelegate<StreamRecord<T>> record, int numberOfOutputChannels); StreamPartitioner<T> copy(); @Override String toString();  }
@Test public void testSelectChannelsLength() { sd.setInstance(streamRecord); assertEquals(1, forwardPartitioner.selectChannels(sd, 1).length); assertEquals(1, forwardPartitioner.selectChannels(sd, 2).length); assertEquals(1, forwardPartitioner.selectChannels(sd, 1024).length); }
@Test public void testSelectChannelsInterval() { sd.setInstance(streamRecord); assertEquals(0, forwardPartitioner.selectChannels(sd, 1)[0]); assertEquals(0, forwardPartitioner.selectChannels(sd, 2)[0]); assertEquals(0, forwardPartitioner.selectChannels(sd, 1024)[0]); }