### Question:
KnowledgeRawSchemaShort implements RawSchema { @Override public List<IndexPartitions.Partition> getPartitions(String type) { switch (type) { case ENTITY : return generatePartitions(ENTITY); case RELATION: return generatePartitions(RELATION); case INSIGHT: return generatePartitions(INSIGHT); case REFERENCE: return generatePartitions(REFERENCE); } return Collections.emptyList(); } @Inject  KnowledgeRawSchemaShort(Config config);  KnowledgeRawSchemaShort(); @Override Iterable<String> indices(); @Override String getIdFormat(String type); @Override String getIndexPrefix(String type); @Override String getIdPrefix(String type); @Override IndexPartitions getPartition(String type); @Override List<IndexPartitions.Partition> getPartitions(String type); IndexPartitions.Partition.Default<String> addDefaultPartition(String type); IndexPartitions.Partition.Range.Impl<String> buildIndexPartition(int index,String type); static final String FUSE; static final String ID_FORMAT; static final String ID_BULK; static final String INDICES_COUNT; static final String DEFAULT_ID_FORMAT; static final int DEFAULT_INDICES_COUNT; static final int ID_BULK_SIZE; static final String ENTITY; static final String EVALUE; static final String RELATION; static final String RVALUE; static final String INSIGHT; static final String REFERENCE; static final String EFILE; }### Answer:
@Test public void testGetPartitions(){ KnowledgeRawSchemaShort rawSchemaShort = new KnowledgeRawSchemaShort(); List<IndexPartitions.Partition> partitions = rawSchemaShort.getPartitions(ENTITY); KnowledgeRawSchemaShort finalRawSchemaShort = rawSchemaShort; List<IndexPartitions.Partition.Range<String>> list = rangeClosed(0, DEFAULT_INDICES_COUNT) .mapToObj(e -> finalRawSchemaShort.buildIndexPartition(e, ENTITY)) .collect(Collectors.toList()); list.add(finalRawSchemaShort.addDefaultPartition(ENTITY)); Assert.assertEquals(list,partitions); rawSchemaShort = new KnowledgeRawSchemaShort(); partitions = rawSchemaShort.getPartitions(RELATION); KnowledgeRawSchemaShort finalRawSchemaShort1 = rawSchemaShort; list = rangeClosed(0, DEFAULT_INDICES_COUNT) .mapToObj(e -> finalRawSchemaShort1.buildIndexPartition(e, RELATION)) .collect(Collectors.toList()); list.add(finalRawSchemaShort.addDefaultPartition(RELATION)); Assert.assertEquals(list,partitions); rawSchemaShort = new KnowledgeRawSchemaShort(); partitions = rawSchemaShort.getPartitions(INSIGHT); KnowledgeRawSchemaShort finalRawSchemaShort2 = rawSchemaShort; list = rangeClosed(0, DEFAULT_INDICES_COUNT) .mapToObj(e -> finalRawSchemaShort2.buildIndexPartition(e, INSIGHT)) .collect(Collectors.toList()); list.add(finalRawSchemaShort.addDefaultPartition(INSIGHT)); Assert.assertEquals(list,partitions); rawSchemaShort = new KnowledgeRawSchemaShort(); partitions = rawSchemaShort.getPartitions(REFERENCE); KnowledgeRawSchemaShort finalRawSchemaShort3 = rawSchemaShort; list = rangeClosed(0, DEFAULT_INDICES_COUNT) .mapToObj(e -> finalRawSchemaShort3.buildIndexPartition(e, REFERENCE)) .collect(Collectors.toList()); list.add(finalRawSchemaShort.addDefaultPartition(REFERENCE)); Assert.assertEquals(list,partitions); }