@Test
public void testWrite() throws IOException {

  final byte[] input = new byte[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
  final byte[] expected = this.writeableMessageDigest.getMessageDigest().digest(input);
  final ByteBuffer buf = ByteBuffer.wrap(input);
  assertEquals(buf.capacity(), this.writeableMessageDigest.write(buf));
  final byte[] actual = this.writeableMessageDigest.getMessageDigest().digest();
  assertArrayEquals(expected, actual);
}