public static <T, U extends Fork> ForksSchedule<T> create(
      final T initial, final List<U> forks, final SpecCreator<T, U> specCreator) {
    checkArgument(
        forks.stream().allMatch(f -> f.getForkBlock() > 0),
        "Transition cannot be created for genesis block");
    checkArgument(
        forks.stream().map(Fork::getForkBlock).distinct().count() == forks.size(),
        "Duplicate transitions cannot be created for the same block");

    final NavigableSet<ForkSpec<T>> specs = new TreeSet<>(Comparator.comparing(ForkSpec::getBlock));
    final ForkSpec<T> initialForkSpec = new ForkSpec<>(0, initial);
    specs.add(initialForkSpec);

    forks.stream()
        .sorted(Comparator.comparing(Fork::getForkBlock))
        .forEachOrdered(
            f -> {
              final T spec = specCreator.create(specs.last(), f);
              specs.add(new ForkSpec<>(f.getForkBlock(), spec));
            });

    return new ForksSchedule<>(specs);
  }
Create forks schedule.

@param <T> the type parameter ConfigOptions
@param <U> the type parameter Fork
@param initial the initial
@param forks the forks
@param specCreator the spec creator
@return the forks schedule
consensus/common/src/main/java/org/hyperledger/besu/consensus/common/ForksScheduleFactory.java