class HostWhitelist {

    private RouterConfig config;

    public  HostWhitelist() {
        config = RouterConfig.load();
    }

    public boolean isHostAllowed(URI serviceUri) {<FILL_FUNCTION_BODY>}

}

        if (serviceUri != null) {
            List<String> hostWhitelist = config.getHostWhitelist();
            if (hostWhitelist == null || hostWhitelist.size() == 0) {
                throw new ConfigException("No whitelist defined to allow the route to " + serviceUri);
            }
            String host = serviceUri.getHost();
            return hostWhitelist.stream().anyMatch(
                    hostRegEx -> host != null && host.matches(hostRegEx));
        } else {
            return false;
        }
    
<no_super_class>