@Override
    protected InputStream decorate(final InputStream in, final MessageDigest digest) throws IOException {
        if(null == digest) {
            log.warn("MD5 calculation disabled");
            return super.decorate(in, null);
        }
        else {
            return new DigestInputStream(in, digest);
        }
    }
@Test
    public void testDecorate() throws Exception {
        final NullInputStream n = new NullInputStream(1L);
        assertSame(NullInputStream.class, new SwiftSmallObjectUploadFeature(session, new SwiftWriteFeature(
            session, new SwiftRegionService(session))).decorate(n, null).getClass());
    }