@Test
    void acceptedServerNamesCanBeRestricted() throws Exception {
        String requiredServerName = "myhostname";
        JettyTestDriver driver = JettyTestDriver.newConfiguredInstance(
                new EchoRequestHandler(),
                new ServerConfig.Builder(),
                new ConnectorConfig.Builder()
                        .serverName(new ConnectorConfig.ServerName.Builder().allowed(requiredServerName)));
        int listenPort = driver.server().getListenPort();
        HttpGet req = new HttpGet("http://localhost:" + listenPort + "/");
        req.setHeader("Host", requiredServerName);
        driver.client().execute(req).expectStatusCode(is(OK));
        driver.client().get("/").expectStatusCode(is(NOT_FOUND));
        assertTrue(driver.close());
    }
@author Oyvind Bakksjo
@author Simon Thoresen Hult
@author bjorncs
container-core/src/test/java/com/yahoo/jdisc/http/server/jetty/HttpServerTest.java