Buggy code:
public class ConstructCoNLLYagoDocumentSet { private static CatDataTools dataTools = new CatDataTools ( ) ; private static PipelineNLPStanford stanfordPipeline ; public static void main ( String [ ] args ) { } private static Map < String , List < List < String > > > [ ] splitYagoDataIntoDocumentSets ( File yagoInputFile ) { Map < String , List < List < String > > > trainData = new HashMap < String , List < List < String > > > ( ) ; Map < String , List < List < String > > > testaData = new HashMap < String , List < List < String > > > ( ) ; Map < String , List < List < String > > > testbData = new HashMap < String , List < List < String > > > ( ) ; BufferedReader reader = FileUtil . getFileReader ( yagoInputFile . getAbsolutePath ( ) ) ; try { String documentName = null ; String documentSet = null ; List < List < String > > documentLines = null ; List < String > sentenceLines = null ; String line = null ; while ( ( line = reader . readLine ( ) ) != null ) { if ( line . startsWith ( "-DOCSTART-" ) ) { if ( documentSet != null ) { if ( documentSet . equals ( "train" ) ) trainData . put ( documentName , documentLines ) ; else if ( documentSet . equals ( "testa" ) ) testaData . put ( documentName , documentLines ) ; else if ( documentSet . equals ( "testb" ) ) testbData . put ( documentName , documentLines ) ; } String docId = line . substring ( "-DOCSTART-<seq2seq4repair_space>(" . length ( ) , ( ( line . length ( ) ) - 1 ) ) ; String [ ] docIdParts = docId . split ( "<seq2seq4repair_space>" ) ; documentName = ( ( docIdParts [ 0 ] ) + "_" ) + ( docIdParts [ 1 ] ) ; if ( docIdParts [ 0 ] . endsWith ( "testa" ) ) documentSet = "testa" ; else <START_BUG> if ( docIdParts [ 1 ] . endsWith ( "testb" ) ) <END_BUG> documentSet = "testb" ; else documentSet = "train" ; documentLines = new ArrayList < List < String > > ( ) ; sentenceLines = new ArrayList < String > ( ) ; } else if ( ( line . trim ( ) . length ( ) ) == 0 ) { documentLines . add ( sentenceLines ) ; sentenceLines = new ArrayList < String > ( ) ; } else { sentenceLines . add ( line ) ; } } if ( documentSet . equals ( "train" ) ) trainData . put ( documentName , documentLines ) ; else if ( documentSet . equals ( "testa" ) ) testaData . put ( documentName , documentLines ) ; else if ( documentSet . equals ( "testb" ) ) testbData . put ( documentName , documentLines ) ; } catch ( IOException e ) { return null ; } @ SuppressWarnings ( "unchecked" ) Map < String , List < List < String > > > [ ] returnData = new HashMap [ 3 ] ; returnData [ 0 ] = trainData ; returnData [ 1 ] = testaData ; returnData [ 2 ] = testbData ; return returnData ; } private static boolean constructAnnotatedDocumentSetFromYagoTsvLines ( String name , Map < String , List < List < String > > > documentLines ) { } private static DocumentNLP constructAnnotatedDocumentFromYagoTsvLines ( String documentName , List < List < String > > lines ) { } private static Pair < JSONObject , Map < AnnotationTypeNLP < String > , List < Pair < Triple < Integer , Integer , Integer > , String > > > > constructJSONObjectAndAnnotationsFromYagoTsvLines ( String documentName , List < List < String > > lines ) { } private static void addAnnotation ( Map < AnnotationTypeNLP < String > , List < Pair < Triple < Integer , Integer , Integer > , String > > > annotations , int sentenceIndex , int annotatedSpanStart , int annotatedSpanEnd , String wikiUrl , String freebaseTopic , List < String > freebaseTypes ) { } }

Fix:
if ( docIdParts [ 0 ] . endsWith ( "testb" ) )