code: public boolean overlaps(Interval<E> other)
    {
      if (other == null) return false;
      int comp12 = this.first.compareTo(other.second());
      int comp21 = this.second.compareTo(other.first());
      if (comp12 > 0 || comp21 < 0) {
        return false;
      } else {
        if (comp12 == 0) {
          if (!this.includesBegin() || !other.includesEnd()) {
            return false;
          }
        }
        if (comp21 == 0) {
          if (!this.includesEnd() || !other.includesBegin()) {
            return false;
          }
        }
        return true;
      }
    }
docs: Check whether this interval overlaps with the other interval
  (i.e. the intersect would not be null)
  @param other interval to compare with
  @return true if this interval overlaps the other interval