Simple question, simple answer:
// does this interval a intersect b? public boolean intersects(Interval b) { Interval a = this; if (b.left <= a.right && b.left >= a.left) { return true; } if (a.left <= b.right && a.left >= b.left) { return true; } return false; }