core/src/main/java/org/apache/druid/java/util/common/collect/Utils.java
/**
   * Like Guava's {@link com.google.common.collect.Iterators#mergeSorted(Iterable, Comparator)}, but avoids
   * calling next() on any iterator prior to returning the value returned by the previous call to next(). This is
   * important when merging iterators that reuse container objects across calls to next().
   *
   * If the Iterators are {@link org.apache.druid.java.util.common.parsers.CloseableIterator}, use
   * {@link org.apache.druid.java.util.common.CloseableIterators#mergeSorted} instead.
   */
Like Guava's  com.google.common.collect.Iterators#mergeSorted(Iterable, Comparator), but avoids
calling next() on any iterator prior to returning the value returned by the previous call to next(). This is
important when merging iterators that reuse container objects across calls to next().


Like Guava ' s com . google . common . collect . Iterators#mergeSorted ( Iterable Comparator ) but avoids calling next () on any iterator prior to returning the value returned by the previous call to next () . This is important when merging iterators that reuse container objects across calls to next () .
public static <T> Iterator<T> mergeSorted(
      final Iterable<? extends Iterator<? extends T>> sortedIterators,
      final Comparator<? super T> comparator
  )
  {
    return new MergeIterator<>(sortedIterators, comparator);
  }
public static < T > Iterator < T > mergeSorted ( final Iterable < ? extends Iterator < ? extends T > > sortedIterators , final Comparator < ? super T > comparator ) { return new MergeIterator < > ( sortedIterators , comparator ) ; }
Like Guava's {@link com.google.common.collect.Iterators#mergeSorted(Iterable, Comparator)}, but avoids
 calling next() on any iterator prior to returning the value returned by the previous call to next().
Like Guava ' s { @link com . google . common . collect . Iterators#mergeSorted ( Iterable Comparator ) } but avoids calling next () on any iterator prior to returning the value returned by the previous call to next () .