I have an array of items, and I want to create a list (or any iterable) from an instance variable belonging to them.
public void foo(final MyClass... args) {
final List<Baz> properties = new ArrayList<>();
for (final MyClass a : args) {
properties.add(a.getProperty());
}
}
How would I do this using a one-liner stream?