@Test
public void test() {

	ExecutionContext context = newExecutionContext();
	ThreadPool threadPool = new ThreadPool(context);
	
	List<String> itemList = Arrays.asList("item1", "item2", "item3");
	
	List<String> processedItems = new ArrayList<>();
	
	threadPool.consumeWork(itemList.iterator(), new WorkerItemConsumerFactory<String>() {
		@Override
		public Consumer<String> createWorkItemConsumer(WorkerController<String> control) {
			return item -> processedItems.add(item);
		}
	}, 1);
	
	Assert.assertEquals(itemList, processedItems);
}