### Question:
HttpResumableSession extends HttpSessionAbstract { public boolean checkIfUploadFinished(final String sha256) { logger.debug("Write until now: {} for {}", size, httpResumableInfo.getTotalSize()); if (size != httpResumableInfo.getTotalSize()) { return false; } if (session.getState() == CLOSEDCHANNEL) { return true; } logger.debug("Final block received! {}", session); session.newState(ENDTRANSFERS); final R66File r66File = session.getFile(); final File file = r66File.getTrueFile(); if (file.isFile()) { if (!Strings.isNullOrEmpty(sha256)) { try { final byte[] bin = FilesystemBasedDigest.getHash(file, false, DigestAlgo.SHA256); if (!FilesystemBasedDigest.digestEquals(sha256, bin)) { logger.error("Digests differs: {} {}", sha256, FilesystemBasedDigest.getHex(bin)); error(new OpenR66RunnerErrorException("Digest differs"), session.getBusinessObject()); } logger.info("Digest OK"); } catch (final IOException ignore) { logger.warn(ignore); } } else { logger.info("NO DIGEST given"); } final DbTaskRunner runner = session.getRunner(); try { final String finalpath = R66Dir.getFinalUniqueFilename(r66File); logger.debug("File to move from {} to {}", r66File.getTrueFile().getAbsolutePath(), finalpath); if (!r66File.renameTo(runner.getRule().setRecvPath(finalpath))) { logger.error("Cannot move file to final position {}", runner.getRule().setRecvPath(finalpath)); } runner.setFilename(r66File.getFile()); runner.saveStatus(); runPostTask(); authent.finalizeTransfer(this, session); } catch (final OpenR66RunnerErrorException e) { error(e, session.getBusinessObject()); } catch (final CommandAbstractException e) { error(e, session.getBusinessObject()); } return true; } return true; } HttpResumableSession(final HttpResumableInfo resumableInfo,
                       final String rulename, final String comment,
                       final HttpAuthent authent); HttpResumableInfo getHttpResumableInfo(); boolean tryWrite(final HttpResumableInfo resumableInfo,
                          final InputStream stream); boolean valid(final HttpResumableInfo resumableInfo); boolean contains(final HttpResumableInfo resumableInfo); boolean checkIfUploadFinished(final String sha256); @Override String toString();  }### Answer:
@Test public void testCheckIfUploadFinished() throws Exception { HttpResumableSession session = new HttpResumableSession(resumableInfo, "rule", "comment", authent); assertFalse(session.checkIfUploadFinished(null)); }