I'm working on legacy code that builds an index of popular terms in another index. There are no unit tests in place, and the indexing process is a pain to wait for because the first index takes so long to build.

I want to structure the second (popular term) index differently. Is there a best practice for testing to see if a Lucene index is being created properly?

EDIT>> Per @Pascal's advice I'm using a RAMDirectory, then to test the index I just wrote I set up an indexReader and iterate through the term results, printing out each term to make sure the data looks alright.