Last active
November 11, 2015 22:45
-
-
Save jalex19100/0d067f953b6c01d48b57 to your computer and use it in GitHub Desktop.
Adhoc ordering outside of Comparable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ordering<Item> o = new Ordering<Item>() { | |
@Override | |
public int compare(Item left, Item right) { | |
return Ints.compare(left.getValue(), right.getValue()); | |
} | |
}; | |
return o.max(listOfItem); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment