Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Implement a `map`-like without streams
public Collection<Double> extract(Collection<Employee> collection) {
Collection<Double> list = new ArrayList<>();
if( collection == null || collection.isEmpty() ) return list;
for( Employee e : collection ) {
list.add(e.salary);
}
return list;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment