### Question:
KnowledgeRawSchemaShort implements RawSchema { @Override public Iterable<String> indices() { Iterable<String> allIndices = Stream.ofAll(getPartitions(ENTITY)) .appendAll(getPartitions(RELATION)) .appendAll(getPartitions(REFERENCE)) .appendAll(getPartitions(INSIGHT)) .filter(p->!(p instanceof IndexPartitions.Partition.Default<?>)) .flatMap(IndexPartitions.Partition::getIndices).distinct().toJavaList(); return allIndices; } @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 testGetIndices(){ KnowledgeRawSchemaShort rawSchemaShort = new KnowledgeRawSchemaShort(); Stream<String> eS = rangeClosed(0, DEFAULT_INDICES_COUNT).mapToObj(e -> format("%s%d", "e", e)); Stream<String> rS = rangeClosed(0,DEFAULT_INDICES_COUNT).mapToObj(r->format("%s%d","rel",r)); Stream<String> iS = rangeClosed(0,DEFAULT_INDICES_COUNT).mapToObj(i->format("%s%d","i",i)); Stream<String> refS = rangeClosed(0,DEFAULT_INDICES_COUNT).mapToObj(ref->format("%s%d","ref",ref)); List<String> list = Stream.concat(Stream.concat(eS, rS), Stream.concat(refS,iS)).collect(Collectors.toList()); Iterable<String> indices = rawSchemaShort.indices(); List<String> expected = StreamSupport.stream(indices.spliterator(), false).collect(Collectors.toList()); expected.sort(String::compareTo); list.sort(String::compareTo); Assert.assertEquals(list,expected); }