Skip to content

Instantly share code, notes, and snippets.

@liviutudor
Created April 1, 2017 00:49
Embed
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