DigestHash implements StatefulHash { @Override public int length() { return digest.getDigestLength(); } DigestHash(MessageDigest digest); @Override String algorithm(); @Override int length(); @Override boolean supportsUnsafe(); @Override StatefulHash createNew(); @Override boolean supportsIncremental(); @Override void reset(); @Override void update(byte[] input); @Override void update(byte[] input, int index, int length); @Override void update(ByteBuffer input); @Override void update(long address, long length); @Override byte[] getBytes(); @Override int getBytes(byte[] output, int index, int maxLength); @Override byte getByte(); @Override short getShort(); @Override int getInt(); @Override long getLong();  }
@Test public void testLength() { assertEquals(16, hash.length()); }