@Test public void testDigestIsDeterministic() throws java.io.IOException {

  DeadEndDigestOutputStream stream1 = new DeadEndDigestOutputStream();
  DeadEndDigestOutputStream stream2 = new DeadEndDigestOutputStream();
  assertEquals(stream1.getDigestString(), stream2.getDigestString());
  stream1.write(123); stream2.write(123);
  assertEquals(stream1.getDigestString(), stream2.getDigestString());
  stream1.close();
  stream2.close();
}