question: public void assertAllQueries ( MemoryIndex memory , Directory ramdir , Analyzer analyzer ) throws Exception { IndexReader reader = DirectoryReader . open ( ramdir ) ; IndexSearcher ram = newSearcher ( reader ) ; IndexSearcher mem = memory . createSearcher ( ) ; QueryParser qp = new QueryParser ( "foo" , analyzer ) ; for ( String query : queries ) { TopDocs ramDocs = ram . search ( qp . parse ( query ) , 1 ) ; TopDocs memDocs = mem . search ( qp . parse ( query ) , 1 ) ; assertEquals ( query , ramDocs . totalHits , memDocs . totalHits ) ; } reader . close ( ) ; }
target:  Run all queries against both the RAMDirectory and MemoryIndex, ensuring they are the same.