import java.util.*;
class Ideone {
public static void main
(String[] args
) { List<String> list = new ArrayList<String>();
list.add("a");
list.add("b");
list.add("c");
Iterator<String> i = list.iterator();
while (i.hasNext()) {
System.
out.
println("Antes => " + nome
); if (nome == "b") i.remove();
System.
out.
println("Depois => " + nome
); }
}
}
//https://pt.stackoverflow.com/q/341518/101
aW1wb3J0IGphdmEudXRpbC4qOwoKY2xhc3MgSWRlb25lIHsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKQl7CgkJTGlzdDxTdHJpbmc+IGxpc3QgPSBuZXcgQXJyYXlMaXN0PFN0cmluZz4oKTsKCQlsaXN0LmFkZCgiYSIpOwoJCWxpc3QuYWRkKCJiIik7CgkJbGlzdC5hZGQoImMiKTsKCQlJdGVyYXRvcjxTdHJpbmc+IGkgPSBsaXN0Lml0ZXJhdG9yKCk7CgkJd2hpbGUgKGkuaGFzTmV4dCgpKSB7CgkJICAgIFN0cmluZyBub21lID0gaS5uZXh0KCk7CiAgICAgICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbigiQW50ZXMgPT4gIiArIG5vbWUpOwoJCSAgICBpZiAobm9tZSA9PSAiYiIpIGkucmVtb3ZlKCk7CgkJICAgIFN5c3RlbS5vdXQucHJpbnRsbigiRGVwb2lzID0+ICIgKyBub21lKTsKCQl9Cgl9Cn0KCi8vaHR0cHM6Ly9wdC5zdGFja292ZXJmbG93LmNvbS9xLzM0MTUxOC8xMDE=