Skip to content

Instantly share code, notes, and snippets.

@Onaiplee
Created April 27, 2017 21:40
Show Gist options
  • Save Onaiplee/1eed47cf987e027c70a03ba2c97c31bf to your computer and use it in GitHub Desktop.
Save Onaiplee/1eed47cf987e027c70a03ba2c97c31bf to your computer and use it in GitHub Desktop.
oracle phone
class IntervalComparator implements Comparator<Interval> {
@Override
public int compare(Interval i1, Interval i2) {
return i1.start == i2.start ? Long.compare(i1.end, i2.end) : Long.compare(i1.start, i2.start);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment