public static void endMethod() {
		Stack<Frame> stack;
		synchronized (state) {
			stack = state.get(Thread.currentThread());
			assert stack != null : "An error occured: no stack available";
			assert stack.size() > 0 : "An error occured: we are leaving a method which we have never entered.";
			stack.pop();
			if (stack.size() == 0) {
				state.remove(Thread.currentThread());
			}
		}
	}