Buggy code:
public class Glmtk { private static final Logger LOGGER = LogManager . getFormatterLogger ( Glmtk . class ) ; private static class NeededComputations { private boolean tagging ; private Set < Pattern > absolute ; private Set < Pattern > continuation ; public NeededComputations ( boolean tagging , Set < Pattern > absolute , Set < Pattern > continuation ) { } public boolean needTagging ( ) { } public Set < Pattern > getAbsolute ( ) { } public Set < Pattern > getContinuation ( ) { } } private Path corpus ; private Path workingDir ; private Path statusFile ; private Path trainingFile ; private Path untaggedTrainingFile ; private Path countsDir ; private Path absoluteDir ; private Path absoluteChunkedDir ; private Path continuationDir ; private Path continuationChunkedDir ; private Path nGramTimesFile ; private Path lengthDistributionFile ; private Path queriesCacheDir ; private Path queriesDir ; private Status status ; private CountCache countCache = null ; public Glmtk ( Path corpus , Path workingDir ) throws Exception { } private Map < String , Path > getCountPaths ( Path base ) { } public Path getWorkingDir ( ) { } public Path getTrainingFile ( ) { } public Path getUntaggedTrainingFile ( ) { } public Path getCountsDir ( ) { } public Path getAbsoluteDir ( ) { } public Path getAbsoluteChunkedDir ( ) { } public Path getContinuationDir ( ) { } public Path getContinuationChunkedDir ( ) { } public Path getnGramTimesFile ( ) { } public Path getLengthDistributionFile ( ) { } public Path getQueriesCacheDir ( ) { } public Path getQueriesDir ( ) { } public void count ( Set < Pattern > neededPatterns ) throws Exception { } private Glmtk . NeededComputations computeNeeded ( Set < Pattern > neededPatterns ) { } private void provideTraining ( boolean needTagging ) throws IOException { } private void countAbsolute ( Set < Pattern > neededPatterns ) throws Exception { Glmtk . LOGGER . info ( "Absolute<seq2seq4repair_space>counting<seq2seq4repair_space>'%s'<seq2seq4repair_space>-><seq2seq4repair_space>'%s'." , trainingFile , absoluteDir ) ; Set < Pattern > countingPatterns = new HashSet < Pattern > ( neededPatterns ) ; countingPatterns . removeAll ( status . getCounted ( false ) ) ; Set < Pattern > chunkingPatterns = new HashSet < Pattern > ( countingPatterns ) ; <START_BUG> countingPatterns . removeAll ( status . getChunkedPatterns ( false ) ) ; <END_BUG> Glmtk . LOGGER . debug ( "neededPatterns<seq2seq4repair_space>=<seq2seq4repair_space>%s" , neededPatterns ) ; Glmtk . LOGGER . debug ( "countingPatterns<seq2seq4repair_space>=<seq2seq4repair_space>%s" , countingPatterns ) ; Glmtk . LOGGER . debug ( "chunkingPatterns<seq2seq4repair_space>=<seq2seq4repair_space>%s" , chunkingPatterns ) ; CHUNKER . chunkAbsolute ( chunkingPatterns , status , trainingFile , absoluteChunkedDir ) ; MERGER . mergeAbsolute ( status , countingPatterns , absoluteChunkedDir , absoluteDir ) ; } private void countContinuation ( Set < Pattern > neededPatterns ) throws Exception { } public CountCache getOrCreateCountCache ( ) throws IOException { } public CountCache getOrCreateTestCountCache ( Path testingFile , Set < Pattern > neededPatterns ) throws IOException { } private Set < String > extractSequencesForPattern ( Path testingFile , boolean hasPos , Pattern pattern ) throws IOException { } private void filterAndWriteTestCounts ( Path countFile , Path testCountFile , SortedSet < String > neededSequences ) throws IOException { } public Query newQuery ( String queryTypeString , Path inputFile , Estimator estimator , ProbMode probMode , CountCache countCache ) { } }

Fix:
chunkingPatterns . removeAll ( status . getChunkedPatterns ( false ) ) ;