### Question:
VMUtils { public static Map<String, Object> getCombinedLocals(Context ctx) { ThreadId threadId = ctx.execution().currentThreadId(); State state = ctx.execution().state(); return getCombinedLocals(state, threadId); } private  VMUtils(); static Map<String, Object> prepareInput(ExpressionEvaluator ee,
                                                   Context ctx,
                                                   Map<String, Serializable> input); static T assertLocal(State state, ThreadId threadId, String key); @SuppressWarnings("unchecked") static T getLocal(State state, ThreadId threadId, String key); @SuppressWarnings("unchecked") static T getCombinedLocal(State state, ThreadId threadId, String key); static boolean hasCombinedLocal(State state, ThreadId threadId, String key); static Map<String, Object> getCombinedLocals(Context ctx); static Map<String, Object> getCombinedLocals(State state, ThreadId threadId); static void putLocal(State state, ThreadId threadId, String key, Object value); static void putLocal(Frame frame, String key, Object value); static void putLocals(Frame frame, Map<String, Object> locals); static Frame assertNearestRoot(State state, ThreadId threadId);  }### Answer:
@Test public void testLocals() { Frame rootFrame = Frame.builder() .root() .locals(Collections.singletonMap("x", 123)) .build(); State state = new InMemoryState(rootFrame); ThreadId threadId = state.getRootThreadId(); Frame levelOneFrame = Frame.builder().nonRoot() .locals(Collections.singletonMap("y", 234)) .build(); state.pushFrame(threadId, levelOneFrame); Frame levelTwoFrame = Frame.builder().nonRoot() .locals(Collections.singletonMap("x", 345)) .build(); state.pushFrame(threadId, levelTwoFrame); Map<String, Object> locals = VMUtils.getCombinedLocals(state, threadId); assertEquals(2, locals.size()); assertEquals(345, locals.get("x")); assertEquals(234, locals.get("y")); }