import java.util.ArrayList;
import java.util.ConcurrentModificationException;
import java.util.List;
//纯属娱乐
public class E {
public static void main(String[] args) {
List<String> alist = new ArrayList<>();
alist.add("111");
alist.add("222");
alist.add("333");
alist.add("444");
alist.add("555");
System.out.println(alist);
ceui(alist);
System.err.println(alist);
}
private static void ceui(List<String> alist) {
try {
alist.forEach((item) -> {
if (item.equals("222") || item.equals("444")) {
alist.remove(item);
}
});
} catch (ConcurrentModificationException e) {
ceui(alist);
}
}
}