Buggy code:
public abstract class FacetTestBase extends LuceneTestCase { private static final class SearchTaxoDirPair { Directory searchDir ; Directory taxoDir ; SearchTaxoDirPair ( ) { } } private static HashMap < Integer , FacetTestBase . SearchTaxoDirPair > dirsPerPartitionSize ; private static File TEST_DIR ; protected static final String CONTENT_FIELD = "content" ; protected TaxonomyReader taxoReader ; protected IndexReader indexReader ; protected IndexSearcher searcher ; @ BeforeClass public static void beforeClassFacetTestBase ( ) throws Exception { } @ AfterClass public static void afterClassFacetTestBase ( ) throws Exception { } private static final String [ ] DEFAULT_CONTENT = new String [ ] { "the<seq2seq4repair_space>white<seq2seq4repair_space>car<seq2seq4repair_space>is<seq2seq4repair_space>the<seq2seq4repair_space>one<seq2seq4repair_space>I<seq2seq4repair_space>want." , "the<seq2seq4repair_space>white<seq2seq4repair_space>dog<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>belong<seq2seq4repair_space>to<seq2seq4repair_space>anyone." } ; private static final CategoryPath [ ] [ ] DEFAULT_CATEGORIES = new CategoryPath [ ] [ ] { new CategoryPath [ ] { new CategoryPath ( "root" , "a" , "f1" ) , new CategoryPath ( "root" , "a" , "f2" ) } , new CategoryPath [ ] { new CategoryPath ( "root" , "a" , "f1" ) , new CategoryPath ( "root" , "a" , "f3" ) } } ; protected List < CategoryPath > getCategories ( int doc ) { } protected int numDocsToIndex ( ) { } protected String getContent ( int doc ) { } protected final void initIndex ( ) throws Exception { } protected final void initIndex ( int partitionSize ) throws Exception { } protected final void initIndex ( int partitionSize , boolean forceDisk ) throws Exception { } protected IndexWriterConfig getIndexWriterConfig ( Analyzer analyzer ) { } protected FacetIndexingParams getFacetIndexingParams ( final int partSize ) { } protected FacetSearchParams getFacetedSearchParams ( ) { } protected FacetSearchParams getFacetedSearchParams ( int partitionSize ) { } protected void populateIndex ( RandomIndexWriter iw , TaxonomyWriter taxo , FacetIndexingParams iParams ) throws IOException , CorruptIndexException { } protected void closeAll ( ) throws Exception { } protected Analyzer getAnalyzer ( ) { } protected static FacetResultNode [ ] resultNodesAsArray ( FacetResultNode parentRes ) { } protected final void indexDoc ( FacetIndexingParams iParams , RandomIndexWriter iw , TaxonomyWriter tw , String content , List < CategoryPath > categories ) throws IOException , CorruptIndexException { Document d = new Document ( ) ; CategoryDocumentBuilder builder = new CategoryDocumentBuilder ( tw , iParams ) ; builder . setCategoryPaths ( categories ) ; builder . build ( d ) ; <START_BUG> d . add ( new org . apache . lucene . document . Field ( "content" , content , TextField . TYPE_STORED ) ) ; <END_BUG> iw . addDocument ( d ) ; } protected Map < CategoryPath , Integer > facetCountsTruth ( ) throws IOException { } protected static void assertCountsAndCardinality ( Map < CategoryPath , Integer > facetCountsTruth , List < FacetResult > facetResults ) throws Exception { } private static void assertCountsAndCardinality ( Map < CategoryPath , Integer > facetCountsTruth , FacetResultNode resNode , int reqNumResults ) throws Exception { } protected static void assertSameResults ( List < FacetResult > expected , List < FacetResult > actual ) { } private static final String resStringValueOnly ( List < FacetResult > results ) { } public static class NotSameResultError extends Error { public NotSameResultError ( ) { } } }

Fix:
d . add ( new org . apache . lucene . document . TextField ( "content" , content , Store . YES ) ) ;