@Test
  public void shouldReturnAllDefinedIndexes() {
    LuceneServiceImpl luceneServiceImpl = (LuceneServiceImpl) luceneService;
    luceneServiceImpl.createIndexFactory().setFields("field1", "field2", "field3")
        .create(INDEX_NAME, REGION_NAME);
    luceneServiceImpl.createIndexFactory().setFields("field4", "field5", "field6").create("index2",
        "region2");
    final Collection<LuceneIndexCreationProfile> indexList =
        luceneServiceImpl.getAllDefinedIndexes();

    assertEquals(Arrays.asList(INDEX_NAME, "index2"), indexList.stream()
        .map(LuceneIndexCreationProfile::getIndexName).sorted().collect(Collectors.toList()));
    createRegion();
    assertEquals(Collections.singletonList("index2"), indexList.stream()
        .map(LuceneIndexCreationProfile::getIndexName).collect(Collectors.toList()));
  }
Tests of creating lucene indexes on regions. All tests of index creation use cases should be in
classes starting with LuceneIndexCreation*. Most tests belong in this class, except for:
<ul>
<li>Tests that use persistence are in {@link LuceneIndexCreationPersistenceIntegrationTest}</li>
<li>Tests that use offheap are in {@link LuceneIndexCreationOffHeapIntegrationTest}</li>
</ul>
geode-lucene/src/integrationTest/java/org/apache/geode/cache/lucene/LuceneIndexCreationIntegrationTest.java