### Question:
Error extends RuntimeException { public void popContext() { this.context.removeLast(); } private  Error(String errorCode, String msg); private  Error(ArrayDeque<String> context, String errorCode, String msg); static void push(String context); static void pop(); static Error get(String ctx, String errorCode, String msg); static Error get(String ctx, String errorCode, Throwable e); static Error get(String errorCode, String msg); static Error get(String errorCode, Throwable e); static Error get(Throwable e); static Error get(String errorCode); static void reset(); void pushContext(String context); void popContext(); String getErrorCode(); String getMsg(); String getContext(); JsonNode toJson(); @Override String toString(); @Override String getMessage(); static Error fromJson(JsonNode node); static final char DELIMITER; }### Answer:
@Test public void testPopContext() { List<String> contexts = new ArrayList<>(); contexts.add("1"); contexts.add("2"); for (String context : contexts) { Error.push(context); } Error result = Error.get("code"); String pushContext = "3"; result.pushContext(pushContext); result.popContext(); StringBuilder buff = new StringBuilder(); for (String context : contexts) { if (buff.length() > 0) { buff.append(Error.DELIMITER); } buff.append(context); } Assert.assertEquals(buff.toString(), result.getContext()); }