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");
System.
out.
println("Antes => " + i
); if (i == "b") list.remove(i);
System.
out.
println("Depois => " + i
); }
}
}
//https://pt.stackoverflow.com/q/341518/101
aW1wb3J0IGphdmEudXRpbC4qOwoKY2xhc3MgSWRlb25lIHsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKQl7CgkJTGlzdDxTdHJpbmc+IGxpc3QgPSBuZXcgQXJyYXlMaXN0PFN0cmluZz4oKTsKCQlsaXN0LmFkZCgiYSIpOwoJCWxpc3QuYWRkKCJiIik7CgkJbGlzdC5hZGQoImMiKTsKCQlmb3IgKFN0cmluZyBpOiBsaXN0KSB7CiAgICAgICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbigiQW50ZXMgPT4gIiArIGkpOwoJCSAgICBpZiAoaSA9PSAiYiIpIGxpc3QucmVtb3ZlKGkpOwoJCSAgICBTeXN0ZW0ub3V0LnByaW50bG4oIkRlcG9pcyA9PiAiICsgaSk7CgkJfQoJfQp9CgovL2h0dHBzOi8vcHQuc3RhY2tvdmVyZmxvdy5jb20vcS8zNDE1MTgvMTAx