This simple - Longitself provides an implementation:
public int compare(Long l1, Long l2) {
return l1.compareTo(l2);
}
On the other hand, at this moment I'm not sure why you have a custom comparator at all ...
EDIT: if you are actually comparing values Longand using Java 1.7, you can use Long.compare(long, long). Otherwise, complete the current implementation.
source
share