code: private static List<Interval> findInitialSearchInterval(
        VersionedIntervalTimeline<String, DataSegment> timeline,
        Period skipOffset,
        @Nullable List<Interval> skipIntervals
    )
    {
      Preconditions.checkArgument(timeline != null && !timeline.isEmpty(), "timeline should not be null or empty");
      Preconditions.checkNotNull(skipOffset, "skipOffset");
  
      final TimelineObjectHolder<String, DataSegment> first = Preconditions.checkNotNull(timeline.first(), "first");
      final TimelineObjectHolder<String, DataSegment> last = Preconditions.checkNotNull(timeline.last(), "last");
      final List<Interval> fullSkipIntervals = sortAndAddSkipIntervalFromLatest(
          last.getInterval().getEnd(),
          skipOffset,
          skipIntervals
      );
  
      final Interval totalInterval = new Interval(first.getInterval().getStart(), last.getInterval().getEnd());
      final List<Interval> filteredInterval = filterSkipIntervals(totalInterval, fullSkipIntervals);
      final List<Interval> searchIntervals = new ArrayList<>();
  
      for (Interval lookupInterval : filteredInterval) {
        final List<TimelineObjectHolder<String, DataSegment>> holders = timeline.lookup(
            new Interval(lookupInterval.getStart(), lookupInterval.getEnd())
        );
  
        final List<DataSegment> segments = holders
            .stream()
            .flatMap(holder -> StreamSupport.stream(holder.getObject().spliterator(), false))
            .map(PartitionChunk::getObject)
            .filter(segment -> lookupInterval.contains(segment.getInterval()))
            .sorted((s1, s2) -> Comparators.intervalsByStartThenEnd().compare(s1.getInterval(), s2.getInterval()))
            .collect(Collectors.toList());
  
        if (!segments.isEmpty()) {
          searchIntervals.add(
              new Interval(
                  segments.get(0).getInterval().getStart(),
                  segments.get(segments.size() - 1).getInterval().getEnd()
              )
          );
        }
      }
  
      return searchIntervals;
    }
docs: Returns the initial searchInterval which is {@code (timeline.first().start, timeline.last().end - skipOffset)}.
  
  @param timeline      timeline of a dataSource
  @param skipIntervals intervals to skip
  
  @return found interval to search or null if it's not found