### Question:
ArchiveIdentifierMessageDigest extends ArchiveIdentifier { @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + Objects.hash(messageDigest); return result; } ArchiveIdentifierMessageDigest(final ArchiveType archiveType, final String name,
            final LSMessageDigest messageDigest);  ArchiveIdentifierMessageDigest(final ArchiveType archiveType, final String name,
            final String messageDigestHexString); final LSMessageDigest getMessageDigest(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }### Answer:
@Test public void testHashCodeSame() { final ArchiveIdentifierMessageDigest ai1 = new ArchiveIdentifierMessageDigest(ArchiveType.JAVA, "abc", new LSMessageDigest(new byte[] { 1 })); final ArchiveIdentifierMessageDigest ai2 = new ArchiveIdentifierMessageDigest(ArchiveType.JAVA, "abc", new LSMessageDigest(new byte[] { 1 })); Assert.assertEquals("hashCode()", ai1.hashCode(), ai2.hashCode()); }
@Test public void testHashCodeDifferentArchiveType() { final ArchiveIdentifierMessageDigest ai1 = new ArchiveIdentifierMessageDigest(ArchiveType.JAVA, "abc", new LSMessageDigest(new byte[] { 1 })); final ArchiveIdentifierMessageDigest ai2 = new ArchiveIdentifierMessageDigest(ArchiveType.JAVASCRIPT, "abc", new LSMessageDigest(new byte[] { 1 })); Assert.assertNotEquals("hashCode()", ai1.hashCode(), ai2.hashCode()); }
@Test public void testHashCodeDifferentName() { final ArchiveIdentifierMessageDigest ai1 = new ArchiveIdentifierMessageDigest(ArchiveType.JAVA, "abc", new LSMessageDigest(new byte[] { 1 })); final ArchiveIdentifierMessageDigest ai2 = new ArchiveIdentifierMessageDigest(ArchiveType.JAVA, "def", new LSMessageDigest(new byte[] { 1 })); Assert.assertNotEquals("hashCode()", ai1.hashCode(), ai2.hashCode()); }
@Test public void testHashCodeDifferentMessageDigest() { final ArchiveIdentifierMessageDigest ai1 = new ArchiveIdentifierMessageDigest(ArchiveType.JAVA, "abc", new LSMessageDigest(new byte[] { 1 })); final ArchiveIdentifierMessageDigest ai2 = new ArchiveIdentifierMessageDigest(ArchiveType.JAVA, "abc", new LSMessageDigest(new byte[] { 2 })); Assert.assertNotEquals("hashCode()", ai1.hashCode(), ai2.hashCode()); }