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