@Test
public void testCleanup() throws InterruptedException {

	CountDownLatch latch = new CountDownLatch(1);
	CleanupTask task = new CleanupTask() {
		@Override
		public void cleanup(ScannerContext context) {
			latch.countDown();
		}
	};
	new ScannerContext().withName("test").withCleanupTask(task).exec(ctx -> {
		Assertions.assertThat(ctx.getMap().get("name")).isEqualTo("test");
	});
	Assertions.assertThat(latch.await(1, TimeUnit.SECONDS)).isTrue();
}