public Set<Integer> toSet() {Set<Integer> s = new HashSet<Integer>();for (Interval I : intervals) {int a = I.a;int b = I.b;for (int v=a; v<=b; v++) {s.add(v);}}return s;}
public virtual HashSet<int> ToSet(){HashSet<int> s = new HashSet<int>();foreach (Interval I in intervals){int a = I.a;int b = I.b;for (int v = a; v <= b; v++){s.Add(v);}}return s;}