replay(target);
JavaAtomicComponent component = createJavaComponent(target);
AsyncMonitor monitor = createMock(AsyncMonitor.class);
replay(monitor);
WorkScheduler scheduler = createMock(WorkScheduler.class);
scheduler.scheduleWork(isA(Runnable.class));
expectLastCall().andStubAnswer(new IAnswer<Object>() {
public Object answer() throws Throwable {
Runnable runnable = (Runnable) getCurrentArguments()[0];
runnable.run();
return null;