/**
* Creates a new context to run given code, restoring shared context to previous value after execution
* @param codeToRun Code to run in own context
*/
private void runWithOwnSubContext(Runnable codeToRun) {
MappedContext testRunContext = MappedContext.create();
testRunContext.setParentDefinition(parentContext);
TestContext previousContext = sharedContext.get();
sharedContext.set(testRunContext);
try{
codeToRun.run();