boolean f1(List l) { for(Boolean x : l) { if (x == true) return true; } return false; } boolean f2(List l) { for(Boolean x : l) { if (x) return true; } return false; } void g1(List l1) { List l2 = new ArrayList(); for(Boolean x : l1) { l2.add(x == true); } } void g2(List l1) { List l2 = new ArrayList(); for(Boolean x : l1) { if (x == null) { // handle null case } l2.add(x); } }