DownloadTransferListener implements TransferListener { @Override public void bytesTransfered(String file, long bytesTransfered) { totalBytes += bytesTransfered; if (totalBytes % 1024 == 0) { long sizeInMbs = FileUtils.byteCountToDisplaySize(totalBytes); LOGGER.trace("Transfered '{}': {} Mb", file, sizeInMbs); if (session == null) { initSession(file); } session.setTransferredInMbs(sizeInMbs); } }  void setDownloadsSessionManager(
			DownloadsSessionManager downloadsSessionManager); @Override void bytesTransfered(String file, long bytesTransfered);  }
@Test public void shouldNotPublishByteTransferedWhenAreNotSufficient() throws Exception { listener.bytesTransfered(FILENAME, 1000); verify(session, never()).setTransferredInMbs(1000); }
@Test public void shouldPublishByteTransferedWhenAreMultipleOfMB() throws Exception { listener.bytesTransfered(FILENAME, 3145728); verify(session).setTransferredInMbs(3); }