// "Collapse loop with stream 'forEach()'" "true-preview" import java.util.*; public abstract class Collect implements Collection{ class Person { String getName() { return ""; } } void collectNames(List persons){ persons.stream().map(Person::getName).forEach(this::add); } }