private static @NotNull <CommitId> Function<Integer, @NotNull CommitId> createCommitIdMapFunction(@NotNull List<? extends CommitId> commitsIdMap) {
    if (!commitsIdMap.isEmpty() && commitsIdMap.get(0) instanceof Integer) {
      int[] ints = new int[commitsIdMap.size()];
      for (int row = 0; row < commitsIdMap.size(); row++) {
        ints[row] = (Integer)commitsIdMap.get(row);
      }
      //noinspection unchecked
      return (Function<Integer, CommitId>)new IntegerCommitIdMapFunction(CompressedIntList.newInstance(ints));
    }
    return new CommitIdMapFunction<>(commitsIdMap);
  }
private static @NotNull <CommitId> Function<Integer, @NotNull CommitId> createCommitIdMapFunction(@NotNull List<? extends CommitId> commitsIdMap)