Skip to content

Instantly share code, notes, and snippets.

@abyx
Created November 24, 2010 20:22
Show Gist options
  • Select an option

  • Save abyx/714332 to your computer and use it in GitHub Desktop.

Select an option

Save abyx/714332 to your computer and use it in GitHub Desktop.
Comparator<Account> NAME_COMPARATOR = new Comparator<Account>() {
@Override public int compare(Account a1, Account a2) {
if (a1.name == null) {
if (a2.name == null) {
return 0;
}
return -1;
}
return a1.name.compareTo(a2.name);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment