@Override
    @SuppressWarnings("unchecked")
    public <T> T getFeature(final Class<T> type, final Distribution.Method method) {
        if(type == Index.class) {
            if(method.equals(Distribution.WEBSITE)) {
                return (T) this;
            }
        }
        if(type == Cname.class) {
            return (T) this;
        }
        return super.getFeature(type, method);
    }
@Test
    public void testFeatures() {
        final WebsiteCloudFrontDistributionConfiguration d = new WebsiteCloudFrontDistributionConfiguration(
            new S3Session(new Host(new S3Protocol(), new S3Protocol().getDefaultHostname())), new S3LocationFeature(session), new DisabledX509TrustManager(), new DefaultX509KeyManager()
        );
        assertNotNull(d.getFeature(Purge.class, Distribution.DOWNLOAD));
        assertNotNull(d.getFeature(Purge.class, Distribution.WEBSITE_CDN));
        assertNull(d.getFeature(Purge.class, Distribution.STREAMING));
        assertNull(d.getFeature(Purge.class, Distribution.WEBSITE));
        assertNotNull(d.getFeature(Index.class, Distribution.DOWNLOAD));
        assertNotNull(d.getFeature(Index.class, Distribution.WEBSITE_CDN));
        assertNotNull(d.getFeature(Index.class, Distribution.WEBSITE));
        assertNull(d.getFeature(Index.class, Distribution.STREAMING));
        assertNotNull(d.getFeature(DistributionLogging.class, Distribution.DOWNLOAD));
        assertNotNull(d.getFeature(Cname.class, Distribution.DOWNLOAD));
        assertNotNull(d.getFeature(Cname.class, Distribution.WEBSITE));
    }