// "Replace with forEach" "true" import java.util.*; public class Collect { class Person { String getName() { return ""; } } Set names = new HashSet<>(); void collectNames(List persons){ persons.stream().map(Person::getName).forEach(s -> names.add(s)); } }