public ImmutableRangeSet<C> difference(RangeSet<C> other) {
    RangeSet<C> copy = TreeRangeSet.create(this);
    copy.removeAll(other);
    return copyOf(copy);
  }
public ImmutableRangeSet<C> difference(RangeSet<C> other) {
    RangeSet<C> copy = TreeRangeSet.create(this);
    copy.removeAll(other);
    return copyOf(copy);
  }
public ImmutableRangeSet < C > difference ( RangeSet < C > other ) { RangeSet < C > copy = TreeRangeSet . create ( this ) ; copy . removeAll ( other ) ; return copyOf ( copy ) ; }
Returns a new range set consisting of the difference of this range set and {@code other}.

<p>This is essentially the same as {@code TreeRangeSet.create(this).removeAll(other)} except it
returns an {@code ImmutableRangeSet}.

@since 21.0
Returns a new range set consisting of the difference of this range set and { @code other } .