### Question:
Digest extends AbstractDigest { @Override public byte[] getDigest() { return Arrays.copyOf(this.digest, this.digest.length); } Digest(final DigestAlgorithm algorithm, final byte[] digest);  Digest(final byte[] digest); protected  Digest(); @Override DigestAlgorithm getAlgorithm(); @Override byte[] getDigest(); OptionalDigest asOptionalDigest(); static Digest fromString(final String digest); static final Digest SHA1_ZERO; static final Digest SHA1_OF_NO_DATA; }### Answer:
@Test public final void testGetDigest() { final Digest d = new Digest(DigestAlgorithm.SHA1, getTestDigest(20)); final byte[] digestBytes = d.getDigest(); final byte[] testBytes = getTestDigest(20); Assert.assertTrue(Arrays.equals(testBytes, digestBytes)); digestBytes[0] = (byte) (digestBytes[0] + 1); Assert.assertTrue(Arrays.equals(testBytes, d.getDigest())); Assert.assertFalse(Arrays.equals(digestBytes, d.getDigest())); }