### Question:
DataFile implements Serializable { public byte[] calculateDigest() { return calculateDigest(getSha256DigestMethodUrl()); } DataFile(String path, String mimeType);  DataFile(byte[] data, String fileName, String mimeType);  DataFile(InputStream stream, String fileName, String mimeType); protected  DataFile(DSSDocument document);  DataFile(); byte[] calculateDigest(); byte[] calculateDigest(URL method); byte[] calculateDigest(org.digidoc4j.DigestAlgorithm digestType); String getName(); String getId(); long getFileSize(); String getMediaType(); void setMediaType(String mediaType); void saveAs(OutputStream out); void saveAs(String path); byte[] getBytes(); InputStream getStream(); void setId(String dataFileId); DSSDocument getDocument(); void setDocument(DSSDocument document);  }### Answer:
@Test public void testCalculateDigest() throws Exception { Assert.assertEquals("RqDqtqi3rTsWj07rrWc5kATAZIw7T1XHP/NPLCF05RU=", Base64.encodeBase64String(this.dataFile.calculateDigest())); }
@Test public void testCalculateDigestWithEnumTypeSHA256() throws Exception { Assert.assertEquals("RqDqtqi3rTsWj07rrWc5kATAZIw7T1XHP/NPLCF05RU=", Base64.encodeBase64String(this.dataFile.calculateDigest(DigestAlgorithm.SHA256))); }
@Test public void testCalculateDigestWithEnumTypeSHA1() throws Exception { Assert.assertEquals("OQj17m9Rt2vPXYrry+v/KHpf98Q=", Base64.encodeBase64String(this.dataFile.calculateDigest(DigestAlgorithm.SHA1))); }
@Test public void testDigestIsCalculatedOnlyOnce() throws Exception { byte[] digest = this.dataFile.calculateDigest(); Assert.assertEquals(digest, this.dataFile.calculateDigest(new URL("http: }