@Test public void testSetErrors() { BatfishException exception = new BatfishException("sample exception"); BatfishStackTrace stackTrace = new BatfishStackTrace(exception); SortedMap<String, BatfishStackTrace> errors = new TreeMap<>(); errors.put("error", stackTrace); _element.setErrors(errors); assertThat(_element.getErrors().get("error"), is(stackTrace)); } }