Buggy code:
@ Override public int endOffset ( ) { } @ Override public void setOffset ( int startOffset , int endOffset ) { } @ Override public void clear ( ) { } @ Override public boolean equals ( Object other ) { } @ Override public int hashCode ( ) { } @ Override public void copyTo ( AttributeImpl target ) { } } protected class RandomTokenStream extends TokenStream { final String [ ] terms ; final BytesRef [ ] termBytes ; final int [ ] positionsIncrements ; final int [ ] positions ; final int [ ] startOffsets ; final int [ ] endOffsets ; final BytesRef [ ] payloads ; final Map < String , Integer > freqs ; final Map < Integer , Set < Integer > > positionToTerms ; final Map < Integer , Set < Integer > > startOffsetToTerms ; final CharTermAttribute termAtt ; final PositionIncrementAttribute piAtt ; final OffsetAttribute oAtt ; final PayloadAttribute pAtt ; int i = 0 ; protected RandomTokenStream ( int len , String [ ] sampleTerms , BytesRef [ ] sampleTermBytes ) { } protected RandomTokenStream ( int len , String [ ] sampleTerms , BytesRef [ ] sampleTermBytes , boolean offsetsGoBackwards ) { } public boolean hasPayloads ( ) { } @ Override public final boolean incrementToken ( ) throws IOException { } } protected class RandomDocument { private final String [ ] fieldNames ; private final FieldType [ ] fieldTypes ; private final BaseTermVectorsFormatTestCase . RandomTokenStream [ ] tokenStreams ; protected RandomDocument ( int fieldCount , int maxTermCount , BaseTermVectorsFormatTestCase . Options options , String [ ] fieldNames , String [ ] sampleTerms , BytesRef [ ] sampleTermBytes ) { } public Document toDocument ( ) { } } protected class RandomDocumentFactory { private final String [ ] fieldNames ; private final String [ ] terms ; private final BytesRef [ ] termBytes ; protected RandomDocumentFactory ( int distinctFieldNames , int disctinctTerms ) { } public BaseTermVectorsFormatTestCase . RandomDocument newDocument ( int fieldCount , int maxTermCount , BaseTermVectorsFormatTestCase . Options options ) { } } protected void assertEquals ( BaseTermVectorsFormatTestCase . RandomDocument doc , Fields fields ) throws IOException { } protected static boolean equals ( Object o1 , Object o2 ) { } private final ThreadLocal < TermsEnum > termsEnum = new ThreadLocal < TermsEnum > ( ) ; private final ThreadLocal < DocsEnum > docsEnum = new ThreadLocal < DocsEnum > ( ) ; private final ThreadLocal < DocsAndPositionsEnum > docsAndPositionsEnum = new ThreadLocal < DocsAndPositionsEnum > ( ) ; protected void assertEquals ( BaseTermVectorsFormatTestCase . RandomTokenStream tk , FieldType ft , Terms terms ) throws IOException { } protected Document addId ( Document doc , String id ) { } protected int docID ( IndexReader reader , String id ) throws IOException { } public void testRareVectors ( ) throws IOException { } public void testHighFreqs ( ) throws IOException { } public void testLotsOfFields ( ) throws IOException { } public void testMixedOptions ( ) throws IOException { } public void testRandom ( ) throws IOException { } public void testMerge ( ) throws IOException { } public void testClone ( ) throws IOException , InterruptedException { final BaseTermVectorsFormatTestCase . RandomDocumentFactory docFactory = new BaseTermVectorsFormatTestCase . RandomDocumentFactory ( 5 , 20 ) ; final int numDocs = _TestUtil . nextInt ( random ( ) , 100 , 1000 ) ; for ( BaseTermVectorsFormatTestCase . Options options : validOptions ( ) ) { final BaseTermVectorsFormatTestCase . RandomDocument [ ] docs = new BaseTermVectorsFormatTestCase . RandomDocument [ numDocs ] ; for ( int i = 0 ; i < numDocs ; ++ i ) { docs [ i ] = docFactory . newDocument ( _TestUtil . nextInt ( random ( ) , 1 , 3 ) , _TestUtil . nextInt ( random ( ) , 10 , 50 ) , options ) ; } final Directory dir = newDirectory ( ) ; final RandomIndexWriter writer = new RandomIndexWriter ( random ( ) , dir ) ; for ( int i = 0 ; i < numDocs ; ++ i ) { writer . addDocument ( addId ( docs [ i ] . toDocument ( ) , ( "" + i ) ) ) ; } final IndexReader reader = writer . getReader ( ) ; for ( int i = 0 ; i < numDocs ; ++ i ) { final int docID = docID ( reader , ( "" + i ) ) ; assertEquals ( docs [ i ] , reader . getTermVectors ( docID ) ) ; } final AtomicReference < Throwable > exception = new AtomicReference < Throwable > ( ) ; final Thread [ ] threads = new Thread [ 2 ] ; for ( int i = 0 ; i < ( threads . length ) ; ++ i ) { threads [ i ] = new Thread ( ) { @ Override public void run ( ) { try { for ( int i = 0 ; i < ( atLeast ( 100 ) ) ; ++ i ) { final int idx = random ( ) . nextInt ( numDocs ) ; final int docID = docID ( reader , ( "" + idx ) ) ; assertEquals ( docs [ idx ] , reader . getTermVectors ( docID ) ) ; } } catch ( Throwable t ) { exception . set ( t ) ; } } } ; } for ( Thread thread : threads ) { thread . start ( ) ; } for ( Thread thread : threads ) { thread . join ( ) ; } reader . close ( ) ; writer . close ( ) ; dir . close ( ) ; if ( ( exception . get ( ) ) != null ) { <START_BUG> throw new AssertionError ( "One<seq2seq4repair_space>thread<seq2seq4repair_space>threw<seq2seq4repair_space>an<seq2seq4repair_space>exception" , exception . get ( ) ) ; <END_BUG> } } } }

Fix:
throw new RuntimeException ( "One<seq2seq4repair_space>thread<seq2seq4repair_space>threw<seq2seq4repair_space>an<seq2seq4repair_space>exception" , exception . get ( ) ) ;