question: public static int trimList ( List < PngChunk > target , ChunkPredicate predicateRemove ) { Iterator < PngChunk > it = target . iterator ( ) ; int cont = 0 ; while ( it . hasNext ( ) ) { PngChunk c = it . next ( ) ; if ( predicateRemove . match ( c ) ) { it . remove ( ) ; cont ++ ; } } return cont ; }
target:  Remove (in place) the chunks that "match" the predicate See also filterList