### Question:
SplitBasedHashPartitioner extends MultiTableRangePartitioner implements Configurable, DelegatePartitioner { @Override public int getPartition(BulkIngestKey bKey, Value value, int numPartitions) { int indexWithinSplits = super.getPartition(bKey, value, numPartitions); int offsetWithinPartitionerSpace = (bKey.getKey().hashCode() & Integer.MAX_VALUE) % spaceMultiplier; int selectedPartitioner = indexWithinSplits * spaceMultiplier + offsetWithinPartitionerSpace; return selectedPartitioner % numPartitions; }  void setMultiplier(int multiplier); @Override int getPartition(BulkIngestKey bKey, Value value, int numPartitions); @Override void setConf(Configuration conf); @Override void configureWithPrefix(String prefix); static final String PARTITIONER_SPACE_MULTIPLIER; }### Answer:
@Test public void testMultiplierWrapping() throws IllegalAccessException, InstantiationException { int multiplier = 2; int numReducers = 6; Configuration conf = new Configuration(); conf.setInt(SplitBasedHashPartitioner.PARTITIONER_SPACE_MULTIPLIER, multiplier); SplitBasedHashPartitioner partitioner = createPartitioner(conf); for (int i = 0; i < 1000; i++) { verifyPartitionInRange(partitioner.getPartition(createKeyFor("\u0007" + i), new Value(), numReducers), 0, multiplier); } for (int i = 0; i < 1000; i++) { verifyPartitionInRange(partitioner.getPartition(createKeyFor("\u0008" + i), new Value(), numReducers), 2, 4); } }
@Test public void testMultiplierWrappingTableOverride() throws IllegalAccessException, InstantiationException { int multiplier = 2; int numReducers = 6; Configuration conf = new Configuration(); conf.setInt(SplitBasedHashPartitioner.PARTITIONER_SPACE_MULTIPLIER, multiplier + 1); conf.setInt(TABLE_NAME + '.' + SplitBasedHashPartitioner.PARTITIONER_SPACE_MULTIPLIER, multiplier); SplitBasedHashPartitioner partitioner = createPartitioner(conf); for (int i = 0; i < 1000; i++) { verifyPartitionInRange(partitioner.getPartition(createKeyFor("\u0007" + i), new Value(), numReducers), 0, multiplier); } for (int i = 0; i < 1000; i++) { verifyPartitionInRange(partitioner.getPartition(createKeyFor("\u0008" + i), new Value(), numReducers), 2, 4); } }