### Question:
BetterDefaultHandler extends DefaultHandler { protected Deque<SaxElement> getElementStack() { return myElementStack; }  @Override void startElement(String uri, String localName, String qName, Attributes attributes); @Override void endElement(String uri, String localName, String qName); @Override void characters(char[] ch, int start, int length);  }### Answer:
@Test public void testGetElementStack() { assertEquals(0, myTestObject.getElementStack().size()); myTestObject.startElement(myUri, myLocalName, myQName, myAttributes); assertEquals(1, myTestObject.getElementStack().size()); SaxElement element = myTestObject.getElementStack().getFirst(); assertEquals(myUri, element.getUri()); assertEquals(myLocalName, element.getLocalName()); assertEquals(myQName, element.getQName()); Map<String, String> attributes = element.getAttributes(); assertEquals(2, attributes.size()); assertEquals(attributes.get("zero"), "zero-value"); assertEquals(attributes.get("one"), "one-value"); assertEquals("", myTestObject.getCurrentValue()); }