### Question:
RescalePartitioner extends StreamPartitioner<T> { @Override public int[] selectChannels(SerializationDelegate<StreamRecord<T>> record, int numberOfOutputChannels) { this.returnArray[0] = (this.returnArray[0] + 1) % numberOfOutputChannels; return this.returnArray; }  @Override int[] selectChannels(SerializationDelegate<StreamRecord<T>> record, int numberOfOutputChannels); StreamPartitioner<T> copy(); @Override String toString();  }### Answer:
@Test public void testSelectChannelsLength() { sd.setInstance(streamRecord); assertEquals(1, distributePartitioner.selectChannels(sd, 1).length); assertEquals(1, distributePartitioner.selectChannels(sd, 2).length); assertEquals(1, distributePartitioner.selectChannels(sd, 1024).length); }
@Test public void testSelectChannelsInterval() { sd.setInstance(streamRecord); assertEquals(0, distributePartitioner.selectChannels(sd, 3)[0]); assertEquals(1, distributePartitioner.selectChannels(sd, 3)[0]); assertEquals(2, distributePartitioner.selectChannels(sd, 3)[0]); assertEquals(0, distributePartitioner.selectChannels(sd, 3)[0]); }