### Question:
Checksum { public ChecksumAlgorithm getAlgorithm() { return this.checksumAlgorithm; } Checksum( ChecksumAlgorithm checksumAlgorithm ); String getChecksum(); byte[] getChecksumBytes(); ChecksumAlgorithm getAlgorithm(); void reset(); Checksum update( byte[] buffer, int offset, int size ); Checksum update( ByteBuffer buffer); Checksum finish(); boolean compare(byte[] cmp); boolean compare(String hexString);  }### Answer:
@Test public void testConstructSha1() { Checksum checksum = new Checksum( ChecksumAlgorithm.SHA1 ); Assert.assertEquals( "Checksum.algorithm", checksum.getAlgorithm().getAlgorithm(), ChecksumAlgorithm.SHA1 .getAlgorithm() ); }
@Test public void testConstructMd5() { Checksum checksum = new Checksum( ChecksumAlgorithm.MD5 ); Assert.assertEquals( "Checksum.algorithm", checksum.getAlgorithm().getAlgorithm(), ChecksumAlgorithm.MD5 .getAlgorithm() ); }