@Override
    public boolean equals(Object obj) {
        if ( obj==null || !(obj instanceof IntervalSet) ) {
            return false;
        }
        IntervalSet other = (IntervalSet)obj;
		return this.intervals.equals(other.intervals);
	}
Are two IntervalSets equal?  Because all intervals are sorted
 and disjoint, equals is a simple linear walk over both lists
 to make sure they are the same.  Interval.equals() is used
 by the List.equals() method to check the ranges.
runtime/Java/src/org/antlr/v4/runtime/misc/IntervalSet.java