@Test
public void testUnitOfWorkStartEnd() {

    
    UnitOfWork unit = unitOfWorkManager.newUnitOfWork();
    assertThat(unit).isNotNull().isInstanceOf(ManagedUnitOfWork.class);
    assertThat(((ManagedUnitOfWork)unit).delegate()).isInstanceOf(CollectingUnitOfWork.class);
    
    final AtomicInteger counter = new AtomicInteger(0);
    assertThat(counter.get()).isEqualTo(0);
    
    BaseWorkUnit dummyWork = new BaseWorkUnit(counter, (d) -> ((AtomicInteger) d).incrementAndGet());
    unit.start();
    unit.intercept(dummyWork);
    unit.end();
    
    assertThat(counter.get()).isEqualTo(1);        
}