Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Find max in a list of java classes using streams
static class Employee {
String firstName;
String surname;
double salary; //yeah, right!
public Optional<Employee> max(Collection<Employee> collection) {
return, e2) -> (int) Math.signum(e1.salary - e2.salary));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.