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