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;
}

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 ; }
remove ( in place ) the chunks that " match " the predicate see also filterlist
