private static Collection < Utterance > destructiveFilter ( final MMOs root ) { final Collection < Utterance > utterances = new ArrayList <> ( ) ; for ( final MMO mmo : root . getMMO ( ) ) { for ( final Utterance utterance : mmo . getUtterances ( ) . getUtterance ( ) ) { // clear candidates to save heaps of bytes for ( final Phrase phrase : utterance . getPhrases ( ) . getPhrase ( ) ) { phrase . setCandidates ( null ) ; } utterances . add ( utterance ) ; } } return utterances ; }
Beware! Destructive filtering of things we are not interested in in the JAXB data structure .