@@ -0,0 +1,507 @@
+package org.axonframework.common;%0A%0Aimport java.util.Deque;%0Aimport java.util.LinkedList;%0A%0A/**%0A * TODO add javadoc%0A */%0Apublic abstract class Scope %7B%0A%0A    private static final ThreadLocal%3CDeque%3CScope%3E%3E CURRENT_SCOPE = ThreadLocal.withInitial(LinkedList::new);%0A%0A    public void start() %7B%0A        CURRENT_SCOPE.get().push(this);%0A    %7D%0A%0A    public void end() %7B%0A        if (this != CURRENT_SCOPE.get().peek()) %7B%0A            throw new IllegalStateException(%22%22);%0A        %7D%0A        CURRENT_SCOPE.get().pop();%0A    %7D%0A%7D%0A

Introduce abstract Scope object