过滤一个Collection最好的方法

private static List<Integer> filter(List<Integer> list){
    Iterator<Integer> it = list.iterator();
    while(it.hasNext()){
        if(it.next() > 5)
            it.remove();
    }
    return list;
}
原文地址:https://www.cnblogs.com/lxcmyf/p/6529828.html