### Question:
BinaryObject extends RepositoryObject { public Long getFilesize() throws FedoraException { if (filesize == null) { filesize = getResource().getProperty(Premis.hasSize).getLong(); } return filesize; } protected  BinaryObject(PID pid, RepositoryObjectDriver driver,
            RepositoryObjectFactory repoObjFactory); protected  BinaryObject(PID pid, URI contentUri, RepositoryObjectDriver driver,
            RepositoryObjectFactory repoObjFactory); @Override BinaryObject validateType(); @Override RepositoryObject getParent(); InputStream getBinaryStream(); URI getContentUri(); @Override URI getMetadataUri(); String getFilename(); void setFilename(String filename); String getMimetype(); void setMimetype(String mimetype); String getSha1Checksum(); String getMd5Checksum(); void setSha1Checksum(String sha1); void setMd5Checksum(String md5); Long getFilesize(); void setFilesize(Long filesize);  }### Answer:
@Test public void testGetFilesize() { long size = 42; binObj.setFilesize(size); assertTrue(size == binObj.getFilesize()); binObj.setFilesize(null); resource.addProperty(Premis.hasSize, Long.toString(99)); assertTrue(binObj.getFilesize() == 99L); }