### Question:
JavaDigestValue implements DigestValue, Serializable { @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((algorithm == null) ? 0 : algorithm.hashCode()); result = prime * result + ((hexDigest == null) ? 0 : hexDigest.hashCode()); return result; } JavaDigestValue();   JavaDigestValue(DigestAlgorithm algorithm, String hexDigest);   JavaDigestValue(DigestAlgorithm algorithm, byte[] digest); @Override URI getAlgorithmId(); @Override String getHexDigest(); @Override byte[] getDigest(); String toXml(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); static JavaDigestValue getInstance(String xml); static JavaDigestValue getInstance(DigestAlgorithm algorithm,
			byte[] digest); static JavaDigestValue getInstance(DigestAlgorithm algorithm,
			String hexDigest); static JavaDigestValue getInstance(DigestAlgorithm algorithm,
			InputStream byteStream); static JavaDigestValue getInstance(DigestAlgorithm algorithm,
			File file); static Set<JavaDigestValue> createDigestSet(
			Set<DigestAlgorithm> algorithms, InputStream is);  }### Answer:
@Test public void testHashCode() throws FileNotFoundException, URISyntaxException, IOException, NoSuchAlgorithmException { boolean dataTested = false; for (File file : AllCoreTest .getFilesFromResourceDir(AllCoreTest.TEST_DATA_ROOT)) { JavaDigestValue apacheValue = JavaDigestValue.getInstance( DigestAlgorithm.MD5, DigestUtils.md5(new FileInputStream(file))); JavaDigestValue testValue = JavaDigestValue.getInstance( DigestAlgorithm.MD5, file); JavaDigestValue testSha256Value = JavaDigestValue.getInstance( DigestAlgorithm.SHA256, file); assertEquals( "apacheValue.hash() and testValue.hash() should be equal", apacheValue.hashCode(), testValue.hashCode()); assertTrue( "apacheValue.hash() and testSha256Value.has() shouldn't be equal", apacheValue.hashCode() != testSha256Value.hashCode()); dataTested = true; } assertTrue("No data tested as flag no set", dataTested); }