@Override
    public String getTarget() {
        final String hostname = super.getTarget();
        final Matcher matcher = pattern.matcher(hostname);
        if(matcher.matches()) {
            final String simple = matcher.group(2);
            log.warn(String.format("Rewrite hostname target to %s", simple));
            return simple;
        }
        return hostname;
    }
@Test
    public void testSetTarget() {
        assertEquals("s3.dualstack.eu-west-1.amazonaws.com",
            new S3BucketHostnameTrustManager(new DisabledX509TrustManager(), "s3.dualstack.eu-west-1.amazonaws.com").getTarget());
        assertEquals("s3.eu-west-1.amazonaws.com",
            new S3BucketHostnameTrustManager(new DisabledX509TrustManager(), "s3.eu-west-1.amazonaws.com").getTarget());
        assertEquals("cyberduck.s3.dualstack.eu-west-1.amazonaws.com",
            new S3BucketHostnameTrustManager(new DisabledX509TrustManager(), "cyberduck.s3.dualstack.eu-west-1.amazonaws.com").getTarget());
        assertEquals("cyberduck.s3.eu-west-1.amazonaws.com",
            new S3BucketHostnameTrustManager(new DisabledX509TrustManager(), "cyberduck.s3.eu-west-1.amazonaws.com").getTarget());
        assertEquals("duck.s3.dualstack.eu-west-1.amazonaws.com",
            new S3BucketHostnameTrustManager(new DisabledX509TrustManager(), "cyber.duck.s3.dualstack.eu-west-1.amazonaws.com").getTarget());
        assertEquals("duck.s3.eu-west-1.amazonaws.com",
            new S3BucketHostnameTrustManager(new DisabledX509TrustManager(), "cyber.duck.s3.eu-west-1.amazonaws.com").getTarget());
        assertEquals("duck.s3.amazonaws.com",
            new S3BucketHostnameTrustManager(new DisabledX509TrustManager(), "cyber.duck.s3.amazonaws.com").getTarget());
    }