DefaultChannelSelector implements ChannelSelector<T> { @Override public int[] selectChannels(final T record, final int numberOfOutpuChannels) { this.nextChannelToSendTo[0] = (this.nextChannelToSendTo[0] + 1) % numberOfOutpuChannels; return this.nextChannelToSendTo; } DefaultChannelSelector(); @Override int[] selectChannels(final T record, final int numberOfOutpuChannels);  }
@Test public void channelSelect() { final StringRecord dummyRecord = new StringRecord("abc"); final DefaultChannelSelector<StringRecord> selector = new DefaultChannelSelector<StringRecord>(); final int numberOfOutputChannels = 2; int[] selectedChannels = selector.selectChannels(dummyRecord, numberOfOutputChannels); assertEquals(1, selectedChannels.length); assertEquals(1, selectedChannels[0]); selectedChannels = selector.selectChannels(dummyRecord, numberOfOutputChannels); assertEquals(1, selectedChannels.length); assertEquals(0, selectedChannels[0]); }