### Question:
PartitionerCache { public static Text getCategory(Configuration conf, Text tableName) { String categoryName = conf.get(PREFIX_SHARED_MEMBERSHIP + tableName); return categoryName == null ? null : new Text(categoryName); } PartitionerCache(Configuration conf); List<String> validatePartitioners(String[] tableNames, Job job); void createAndCachePartitioners(List<Text> tableNames); Partitioner<BulkIngestKey,Value> getPartitioner(Text tableName); static Text getCategory(Configuration conf, Text tableName);  }### Answer:
@Test public void testGetCategoryForNonMember() throws Exception { PartitionerCache partitionerCache = new PartitionerCache(conf); Assert.assertNull(PartitionerCache.getCategory(conf, new Text("table1"))); }
@Test public void testGetCategoryForMember() throws Exception { PartitionerCache partitionerCache = new PartitionerCache(conf); Assert.assertNull(PartitionerCache.getCategory(conf, new Text("table1"))); }
@Test public void testCorrectCategoriesForMixedConfigurations() throws Exception { conf.set(PartitionerCache.PREFIX_CATEGORY_PARTITIONER + "myCategory", DelegatingPartitionerTest.AlwaysReturnOne.class.getName()); conf.set(PartitionerCache.PREFIX_CATEGORY_PARTITIONER + "anotherCategory", DelegatingPartitionerTest.AlwaysReturnTwo.class.getName()); conf.set(PartitionerCache.PREFIX_SHARED_MEMBERSHIP + "table1", "myCategory"); conf.set(PartitionerCache.PREFIX_SHARED_MEMBERSHIP + "table2", "anotherCategory"); conf.set(PartitionerCache.PREFIX_SHARED_MEMBERSHIP + "table3", "anotherCategory"); PartitionerCache partitionerCache = new PartitionerCache(conf); Assert.assertEquals(new Text("myCategory"), PartitionerCache.getCategory(conf, new Text("table1"))); Assert.assertEquals(new Text("anotherCategory"), PartitionerCache.getCategory(conf, new Text("table2"))); Assert.assertEquals(new Text("anotherCategory"), PartitionerCache.getCategory(conf, new Text("table3"))); Assert.assertNull(PartitionerCache.getCategory(conf, new Text("table4"))); }