Repository: apache/kafka
File: coordinator-common/src/main/java/org/apache/kafka/coordinator/common/runtime/CoordinatorRuntime.java (Java)

Code before:
            this.coordinatorMetrics = coordinatorMetrics;
            return this;
        }

        public Builder<S, U> withSerializer(Serializer<U> serializer) {
            this.serializer = serializer;
            return this;
        }

        public Builder<S, U> withCompression(Compression compression) {
            this.compression = compression;
            return this;
        }

        public Builder<S, U> withAppendLingerMs(OptionalInt appendLingerMs) {
            this.appendLingerMs = appendLingerMs;
            return this;
        }

        public Builder<S, U> withExecutorService(ExecutorService executorService) {
            this.executorService = executorService;
            return this;
        }

        public Builder<S, U> withMaxBufferSizeSupplier(Supplier<Integer> maxBufferSizeSupplier) {
            this.appendMaxBufferSizeSupplier = maxBufferSizeSupplier;
            return this;
        }

        @SuppressWarnings("checkstyle:CyclomaticComplexity")
        public CoordinatorRuntime<S, U> build() {
            if (logPrefix == null)
                logPrefix = "";
            if (logContext == null)
                logContext = new LogContext(logPrefix);
            if (eventProcessor == null)
                throw new IllegalArgumentException("Event processor must be set.");
            if (partitionWriter == null)
                throw new IllegalArgumentException("Partition write must be set.");
            if (loader == null)
                throw new IllegalArgumentException("Loader must be set.");
            if (coordinatorShardBuilderSupplier == null)
                throw new IllegalArgumentException("State machine supplier must be set.");
            if (time == null)
                throw new IllegalArgumentException("Time must be set.");
            if (timer == null)
                throw new IllegalArgumentException("Timer must be set.");
            if (runtimeMetrics == null)
                throw new IllegalArgumentException("CoordinatorRuntimeMetrics must be set.");
            if (coordinatorMetrics == null)
                throw new IllegalArgumentException("CoordinatorMetrics must be set.");

Review comment (suggestion):
nit: Could we name this `withAppendMaxBufferSizeSupplier`? for consistency
```suggestion
        public Builder<S, U> withAppendMaxBufferSizeSupplier(Supplier<Integer> appendMaxBufferSizeSupplier) {
            this.appendMaxBufferSizeSupplier = appendMaxBufferSizeSupplier;
```

Code after:
            this.coordinatorMetrics = coordinatorMetrics;
            return this;
        }

        public Builder<S, U> withSerializer(Serializer<U> serializer) {
            this.serializer = serializer;
            return this;
        }

        public Builder<S, U> withCompression(Compression compression) {
            this.compression = compression;
            return this;
        }

        public Builder<S, U> withAppendLingerMs(OptionalInt appendLingerMs) {
            this.appendLingerMs = appendLingerMs;
            return this;
        }

        public Builder<S, U> withExecutorService(ExecutorService executorService) {
            this.executorService = executorService;
            return this;
        }

        public Builder<S, U> withCachedBufferMaxBytesSupplier(Supplier<Integer> cachedBufferMaxBytesSupplier) {
            this.cachedBufferMaxBytesSupplier = cachedBufferMaxBytesSupplier;
            return this;
        }

        @SuppressWarnings("checkstyle:CyclomaticComplexity")
        public CoordinatorRuntime<S, U> build() {
            if (logPrefix == null)
                logPrefix = "";
            if (logContext == null)
                logContext = new LogContext(logPrefix);
            if (eventProcessor == null)
                throw new IllegalArgumentException("Event processor must be set.");
            if (partitionWriter == null)
                throw new IllegalArgumentException("Partition write must be set.");
            if (loader == null)
                throw new IllegalArgumentException("Loader must be set.");
            if (coordinatorShardBuilderSupplier == null)
                throw new IllegalArgumentException("State machine supplier must be set.");
            if (time == null)
                throw new IllegalArgumentException("Time must be set.");
            if (timer == null)
                throw new IllegalArgumentException("Timer must be set.");
            if (runtimeMetrics == null)
                throw new IllegalArgumentException("CoordinatorRuntimeMetrics must be set.");
            if (coordinatorMetrics == null)
                throw new IllegalArgumentException("CoordinatorMetrics must be set.");