### Question:
DataFile implements Serializable { public long getFileSize() { long fileSize; if (document instanceof StreamDocument || document instanceof FileDocument) { try { fileSize = Files.size(Paths.get(document.getAbsolutePath())); logger.debug("Document size: " + fileSize); return fileSize; } catch (IOException e) { logger.error(e.getMessage()); throw new DigiDoc4JException(e); } } fileSize = getBytes().length; logger.debug("File document size: " + fileSize); return fileSize; } 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 testGetFileSize() throws Exception { Assert.assertEquals(15, this.dataFile.getFileSize()); }
@Test public void testGetFileSizeForInMemoryDocument() { Assert.assertEquals(2, new MockDataFile(new byte[]{1, 2}, "fileName", "text/plain").getFileSize()); }