@classmethod
def unionIntervals(cls, intervals):
    """returns the smallest interval containing all intervals"""
    inter = cls(intervals[0].first, intervals[0].last)
    for i in intervals[1:]:
        inter = cls.union(inter, i)
    return inter
