protected List<FileElement> findOverlapFiles(FileElement fileToCheck) {
    List<FileElement> overlappedFiles = new ArrayList<>();
    Optional<Long> endTimeInCheckingFile = fileToCheck.resource.getEndTime(deviceId);
    for (FileElement otherFile : fileList) {
      if (!endTimeInCheckingFile.isPresent()) {
        continue;
      }
      Optional<Long> startTimeInOtherFile = otherFile.resource.getStartTime(deviceId);
      if (startTimeInOtherFile.isPresent()
          && startTimeInOtherFile.get() <= endTimeInCheckingFile.get()) {
        if (!otherFile.isSelected) {
          overlappedFiles.add(otherFile);
          otherFile.isSelected = true;
        }
      } else {
        break;
      }
    }
    return overlappedFiles;
  }
Find overlapped files which have not been selected. Notice: We must ensure that the returned
list is ordered according to the startTime of the current device in the file from small to
large, so that each file can be compacted in order.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/executor/fast/SeriesCompactionExecutor.java