@Test
  public void generateWithSerializer() {
    cache = new CacheFactory().set(MCAST_PORT, "0").create();
    LuceneService service = LuceneServiceProvider.get(cache);
    createDataRegionAndLuceneIndexWithSerializer(new LuceneTestSerializer(), service);

    LuceneIndex index = generateAndParseXml(service);

    assertArrayEquals(new String[] {"a", "b", "c"}, index.getFieldNames());

    LuceneSerializer testSerializer = index.getLuceneSerializer();
    assertThat(testSerializer).isInstanceOf(LuceneTestSerializer.class);
  }
Test of generating and reading cache configuration back in.
geode-lucene/src/integrationTest/java/org/apache/geode/cache/lucene/internal/xml/LuceneIndexXmlGeneratorIntegrationJUnitTest.java