public static Map<String, List<String>> tagInstantsOfBaseAndLogFiles(
      String basePath, List<StoragePath> allPaths) {
    // Instant time -> Set of base and log file paths
    Map<String, List<String>> instantToFilesMap = new HashMap<>();
    allPaths.forEach(path -> {
      String instantTime = FSUtils.getCommitTime(path.getName());
      instantToFilesMap.computeIfAbsent(instantTime, k -> new ArrayList<>());
      instantToFilesMap.get(instantTime).add(
          FSUtils.getRelativePartitionPath(new StoragePath(basePath), path));
    });
    return instantToFilesMap;
  }
@Test
  public void testTagInstantsOfBaseAndLogFiles() {
    Map<String, List<String>> expectedResult = new HashMap<>();
    List<StoragePath> inputPathList = new ArrayList<>();

    for (Map.Entry<String, List<Pair<String, String>>> entry : BASE_FILE_INFO.entrySet()) {
      String instantTime = entry.getKey();
      List<String> fileNameList = entry.getValue().stream()
          .map(e -> {
            String partitionPath = e.getKey();
            String fileId = e.getValue();
            return new StoragePath(
                new StoragePath(partitionPath), getBaseFilename(instantTime, fileId)).toString();
          })
          .collect(Collectors.toList());
      List<String> expectedList = expectedResult.computeIfAbsent(
          instantTime, k -> new ArrayList<>());
      expectedList.addAll(fileNameList);
      inputPathList.addAll(fileNameList.stream()
          .map(path -> new StoragePath(basePath, path)).collect(Collectors.toList()));
    }

    for (Map.Entry<String, List<Pair<String, String>>> entry : LOG_FILE_INFO.entrySet()) {
      String instantTime = entry.getKey();
      List<String> fileNameList = entry.getValue().stream()
          .map(e -> {
            String partitionPath = e.getKey();
            String fileId = e.getValue();
            return new StoragePath(
                new StoragePath(partitionPath), getLogFilename(instantTime, fileId)).toString();
          })
          .collect(Collectors.toList());
      List<String> expectedList = expectedResult.computeIfAbsent(
          instantTime, k -> new ArrayList<>());
      expectedList.addAll(fileNameList);
      inputPathList.addAll(fileNameList.stream()
          .map(path -> new StoragePath(basePath, path)).collect(Collectors.toList()));
    }

    assertEquals(expectedResult,
        RepairUtils.tagInstantsOfBaseAndLogFiles(basePath, inputPathList));
  }