### Question:
Error extends RuntimeException { @Override public String toString() { return toJson().toString(); } 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 testToString() throws JSONException { Error e = Error.get("a", "b", "c"); String s = e.toString(); JSONAssert.assertEquals("{objectType:error,context:a,errorCode:b,msg:c}", s, false); }