adjacent method

bool adjacent(
  1. Interval other
)

Are two intervals adjacent such as 0..41 and 42..42? */

Implementation

bool adjacent(Interval other) {
  return a == other.b + 1 || b == other.a - 1;
}