private List<LogEntry> getLogEntriesInOrder(List<LogSegmentName> logSegmentsUnderConsideration)
      throws StoreException {
    List<LogEntry> logEntriesInOrder = new ArrayList<>();
    NavigableMap<Offset, IndexSegment> indexSegments = state.index.getIndexSegments();
    for (LogSegmentName logSegmentName : logSegmentsUnderConsideration) {
      LogSegment logSegment = state.log.getSegment(logSegmentName);
      Offset indexSegmentStartOffset = new Offset(logSegmentName, logSegment.getStartOffset());
      while (indexSegmentStartOffset != null && indexSegmentStartOffset.getName().equals(logSegmentName)) {
        IndexSegment indexSegment = indexSegments.get(indexSegmentStartOffset);
        List<MessageInfo> infos = new ArrayList<>();
        indexSegment.getEntriesSince(null, new FindEntriesCondition(Long.MAX_VALUE), infos, new AtomicLong(0), false);
        List<IndexEntry> indexEntries = new ArrayList<>();
        for (MessageInfo info : infos) {
          indexSegment.find(info.getStoreKey())
              .forEach(value -> indexEntries.add(new IndexEntry(info.getStoreKey(), value)));
        }
        addToLogEntriesInOrder(indexEntries, logEntriesInOrder);
        indexSegmentStartOffset = indexSegments.higherKey(indexSegmentStartOffset);
      }
    }
    return logEntriesInOrder;
  }
Gets all the log entries in {@code logSegmentsUnderConsideration} in order of their occurrence in the log.
@param logSegmentsUnderConsideration the log segments whose log entries are required.
@return the log entries in {@code logSegmentsUnderConsideration} in order of their occurrence in the log.
@throws StoreException
ambry-store/src/test/java/com/github/ambry/store/BlobStoreCompactorTest.java