### Question:
JschUploader implements Uploader { @Override public void upload(final Collection<? extends FileRequest> requests) { final EtmPoint point = MONITOR.createPoint(getClass().getName() + ": upload(Collection)"); try { if (requests.isEmpty()) { return; } for (final FileRequest request : requests) { processor.queueUpload(request, ignoreChmodErrors, permissions); } processor.upload(); } finally { point.collect(); } } JschUploader(final JschSftpProcessor processor); @Override void ignoreChmodErrors(final boolean ignoreChmodErrors); @Override void setPermissions(final int permissions); @Override void upload(final Collection<? extends FileRequest> requests);  }### Answer:
@Test public void testUpload() { final JschSftpProcessor processor = mock(StubbedJschSftpProcessor.class); final FileRequest request = mock(FileRequest.class); new JschUploader(processor).upload(Arrays.asList(request)); verify(processor, times(1)).queueUpload(request, false, Uploader.GOD_PERMISSIONS); verify(processor, times(1)).upload(); }
@Test public void testUploadEmptyQueue() { final JschSftpProcessor processor = mock(StubbedJschSftpProcessor.class); final Collection<FileRequest> requests = Collections.<FileRequest> emptyList(); new JschUploader(processor).upload(requests); verify(processor, never()).upload(); }