// "Replace with collect" "false" import java.util.*; public class Collect { class Person { String getName() { return ""; } } void collectNames(List persons){ final Set names = new HashSet<>(), other = new HashSet<>(); if(persons != null) { for (Person person : persons) { names.add(person.getName()); } } System.out.println(names); } }