class IdMapBuilder {

    @NotNull
    static HugeSparseLongArray buildSparseNodeMapping(
        long nodeCount,
        long highestNodeId,
        int concurrency,
        Function<HugeSparseLongArray.Builder, BiLongConsumer> nodeAdder,
        AllocationTracker tracker
    ) {
        HugeSparseLongArray.Builder nodeMappingBuilder = HugeSparseLongArray.Builder.create(
            // We need to allocate space for `highestNode + 1` since we
            // need to be able to store a node with `id = highestNodeId`.
            highestNodeId + 1,
            tracker
        );
        ParallelUtil.readParallel(concurrency, nodeCount, Pools.DEFAULT, nodeAdder.apply(nodeMappingBuilder));
        return nodeMappingBuilder.build();
    }

    private  IdMapBuilder();

}