Repository: netty/netty
File: handler/src/main/java/io/netty/handler/ssl/util/SelfSignedCertificate.java (Java)

Code before:
            return this;
        }

        /**
         * Set the start of the certificate validity period.
         *
         * @param notBefore The start date
         * @return This builder
         */
        public Builder notBefore(Date notBefore) {
            ObjectUtil.checkNotNullWithIAE(notBefore, "notBefore");
            this.notBefore = notBefore;
            return this;
        }

        /**
         * Set the end of the certificate validity period.
         *
         * @param notAfter The start date
         * @return This builder
         */
        public Builder notAfter(Date notAfter) {
            ObjectUtil.checkNotNullWithIAE(notAfter, "notAfter");
            this.notAfter = notAfter;
            return this;
        }

        /**
         * Set the key algorithm. Only RSA and EC are supported.
         *
         * @param algorithm The key algorithm
         * @return This builder
         */
        public Builder algorithm(String algorithm) {
            if ("EC".equalsIgnoreCase(algorithm)) {
                this.algorithm = "EC";
            } else if ("RSA".equalsIgnoreCase(algorithm)) {
                this.algorithm = "RSA";
            } else {
                throw new IllegalArgumentException("Algorithm not valid: " + algorithm);
            }
            return this;
        }

        private SecureRandom randomOrDefault() {
            // Bypass entropy collection by using insecure random generator.
            // We just want to generate it without any delay because it's for testing purposes only.
            return random == null ? ThreadLocalInsecureRandom.current() : random;
        }

        private void generateKeyPairLocally() {

Review comment (suggestion):
```suggestion
        public Builder notAfter(Date notAfter) {
            this.notAfter = ObjectUtil.checkNotNullWithIAE(notAfter, "notAfter");
            return this;
        }
```

Code after:
        }

        /**
         * Set the start of the certificate validity period.
         *
         * @param notBefore The start date
         * @return This builder
         */
        public Builder notBefore(Date notBefore) {
            this.notBefore = ObjectUtil.checkNotNullWithIAE(notBefore, "notBefore");
            return this;
        }

        /**
         * Set the end of the certificate validity period.
         *
         * @param notAfter The start date
         * @return This builder
         */
        public Builder notAfter(Date notAfter) {
            this.notAfter = ObjectUtil.checkNotNullWithIAE(notAfter, "notAfter");
            return this;
        }

        /**
         * Set the key algorithm. Only RSA and EC are supported.
         *
         * @param algorithm The key algorithm
         * @return This builder
         */
        public Builder algorithm(String algorithm) {
            if ("EC".equalsIgnoreCase(algorithm)) {
                this.algorithm = "EC";
            } else if ("RSA".equalsIgnoreCase(algorithm)) {
                this.algorithm = "RSA";
            } else {
                throw new IllegalArgumentException("Algorithm not valid: " + algorithm);
            }
            return this;
        }

        private SecureRandom randomOrDefault() {
            // Bypass entropy collection by using insecure random generator.
            // We just want to generate it without any delay because it's for testing purposes only.
            return random == null ? ThreadLocalInsecureRandom.current() : random;
        }

        private void generateKeyPairLocally() {
            if (keypair != null) {
                return;
            }