### Question:
HotfolderManager { public boolean enoughSpaceAvailable(long maxSpace, URI inputFolder, URI outputFolder, URI errorFolder) throws IOException { long totalFileSize = hotfolder.getUsedSpace(inputFolder) + hotfolder.getUsedSpace(outputFolder) + hotfolder.getUsedSpace(errorFolder); logger.debug("TotalFileSize = " + totalFileSize); if (totalFileSize >= maxSpace) { logger.warn("Size of files is too high. Allowed space for all files is " + maxSpace + ". Size of files in hotfolder: " + totalFileSize + "."); return false; } else { return true; } } HotfolderManager(String serverUrl, String user, String password);   HotfolderManager(Hotfolder initHotfolder); void deleteOutputs(List<OcrOutput> outputs); void deleteImages(List<OcrImage> images); void copyImagesToHotfolder(List<OcrImage> ocrImages); void retrieveResults(List<OcrOutput> ocrOutputs); void createAndSendTicket(AbbyyTicket abbyyTicket, String name); void waitForResults(long timeout, long waitInterval,
			List<OcrOutput> outputs, URI errorResultXmlUri); boolean enoughSpaceAvailable(long maxSpace, URI inputFolder,
		URI outputFolder, URI errorFolder); void deleteTicket(AbbyyTicket abbyyTicket); String readFromErrorFile(URI errorResultUri, String processName);  }### Answer:
@Test public void shouldAcceptMaxSizeOfAllFiles() throws IOException, URISyntaxException { when(hotfolderMock.getUsedSpace(any(URI.class))).thenReturn(1L).thenReturn(2L).thenReturn(3L); boolean enoughSpace = managerSut.enoughSpaceAvailable(7, new URI("http: assertTrue("There should be enough space.", enoughSpace); }
@Test public void shouldHaveTooLittleSpace() throws IOException, URISyntaxException { when(hotfolderMock.getUsedSpace(any(URI.class))).thenReturn(1L).thenReturn(2L).thenReturn(3L); boolean enoughSpace = managerSut.enoughSpaceAvailable(5, new URI("http: assertFalse("There should be too little space", enoughSpace); }