@Test
public void test_MtContextRunnable_copyObject() throws Exception {
ConcurrentMap<String, MtContextThreadLocal<FooPojo>> mtContexts =
new ConcurrentHashMap<String, MtContextThreadLocal<FooPojo>>();
MtContextThreadLocal<FooPojo> parent = new FooMtContextThreadLocal();
parent.set(new FooPojo(PARENT_UNMODIFIED_IN_CHILD, 1));
mtContexts.put(PARENT_UNMODIFIED_IN_CHILD, parent);
MtContextThreadLocal<FooPojo> p = new FooMtContextThreadLocal();
p.set(new FooPojo(PARENT_MODIFIED_IN_CHILD, 2));
mtContexts.put(PARENT_MODIFIED_IN_CHILD, p);
FooTask task = new FooTask("1", mtContexts);
MtContextRunnable mtContextRunnable = MtContextRunnable.get(task);
// create after new Task, won't see parent value in in task!
MtContextThreadLocal<FooPojo> after = new FooMtContextThreadLocal();
after.set(new FooPojo(PARENT_AFTER_CREATE_MTC_TASK, 4));
mtContexts.put(PARENT_AFTER_CREATE_MTC_TASK, after);
Future<?> submit = executorService.submit(mtContextRunnable);
submit.get();