class Builder {

        private final String host;
        private final int port;
        private int securedPort;
        private @Nullable Realm realm;
        private @Nullable List<String> nonProxyHosts;
        private @Nullable ProxyType proxyType;
        private @Nullable Function<Request, HttpHeaders> customHeaders;

        public Builder(String host, int port) {
            this.host = host;
            this.port = port;
            securedPort = port;
        }

        public Builder setSecuredPort(int securedPort) {
            this.securedPort = securedPort;
            return this;
        }

        public Builder setRealm(@Nullable Realm realm) {
            this.realm = realm;
            return this;
        }

        public Builder setRealm(Realm.Builder realm) {
            this.realm = realm.build();
            return this;
        }

        public Builder setNonProxyHost(String nonProxyHost) {
            if (nonProxyHosts == null) {
                nonProxyHosts = new ArrayList<>(1);
            }
            nonProxyHosts.add(nonProxyHost);
            return this;
        }

        public Builder setNonProxyHosts(List<String> nonProxyHosts) {
            this.nonProxyHosts = nonProxyHosts;
            return this;
        }

        public Builder setProxyType(ProxyType proxyType) {
            this.proxyType = proxyType;
            return this;
        }

        public Builder setCustomHeaders(Function<Request, HttpHeaders> customHeaders) {
            this.customHeaders = customHeaders;
            return this;
        }

        public ProxyServer build() {<FILL_FUNCTION_BODY>}
    }

            List<String> nonProxyHosts = this.nonProxyHosts != null ? Collections.unmodifiableList(this.nonProxyHosts) : Collections.emptyList();
            ProxyType proxyType = this.proxyType != null ? this.proxyType : ProxyType.HTTP;
            return new ProxyServer(host, port, securedPort, realm, nonProxyHosts, proxyType, customHeaders);
        
<no_super_class>