### Question:
WatchItemList { public int processItemAll() { int count = 0; synchronized (list) { for (int i = 0; i < size(); i++) { WatchItem item = list.get(i); if (item.getStatus() == ItemStatus.FILE_CAPTURED && processItem(item)) { count++; } } } if (count > 0) { LOGGER.trace("Starts processing {} files for folder {}", count, directoryName); } return count; } WatchItemList(String directoryName, CallbackHandlerDao handlerDao); String getDirectoryName(); String getDirectoryFullName(); WatchItem append(FileHandlerCallback fileHandlerCallback, long timeoutMillis, long fileLengthCheckDelay); WatchItem append(FileHandlerCallback fileHandlerCallback, long timeoutMillis, long fileLengthCheckDelay,
							String fileName); void remove(int index); int size(); WatchItem get(int index); int getIndex(String uuid); WatchItem getItem(String fileName); boolean processItem(WatchItem item); int processItemAll();  }### Answer:
@Test public void processItemAll() throws InterruptedException, ExecutionException { WatchItemList items = new WatchItemList(getDirectory(), null); items.append(fHandler, timeoutMillis, fileLengthCheckDelay); WatchItem item = items.get(0); assertEquals(0, items.processItemAll()); item.setFileName(getFileName()); assertEquals(1, items.processItemAll()); assertEquals(ItemStatus.INPROGRESS, item.getStatus()); item.getFutureResultSync(); }