Skip to content

Instantly share code, notes, and snippets.

@jalex19100
Last active November 11, 2015 22:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jalex19100/0d067f953b6c01d48b57 to your computer and use it in GitHub Desktop.
Save jalex19100/0d067f953b6c01d48b57 to your computer and use it in GitHub Desktop.
Adhoc ordering outside of Comparable
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