public static Iterable<Range> rangesForInterval(Granularity g, final long from, final long to) {
        if (g == Granularity.FULL) {
            return Arrays.asList(new Range(from, to));
        }

        final long snappedStartMillis = g.snapMillis(from);
        final long snappedStopMillis = g.snapMillis(to + g.milliseconds());

        return new IntervalRangeIterator(g, snappedStartMillis, snappedStopMillis);
    }
public static Iterable<Range> rangesForInterval(Granularity g, final long from, final long to) {
        if (g == Granularity.FULL) {
            return Arrays.asList(new Range(from, to));
        }

        final long snappedStartMillis = g.snapMillis(from);
        final long snappedStopMillis = g.snapMillis(to + g.milliseconds());

        return new IntervalRangeIterator(g, snappedStartMillis, snappedStopMillis);
    }
public static Iterable < Range > rangesForInterval ( Granularity g , final long from , final long to ) { if ( g == Granularity . FULL ) { return Arrays . asList ( new Range ( from , to ) ) ; } final long snappedStartMillis = g . snapMillis ( from ) ; final long snappedStopMillis = g . snapMillis ( to + g . milliseconds ( ) ) ; return new IntervalRangeIterator ( g , snappedStartMillis , snappedStopMillis ) ; }
return the Ranges for an interval at this granularity
@param from start time
@param to end time
@return Range[]
return the Ranges for an interval at this granularity