### Question:
ResourceAttributeHandler extends TextAttributeHandler { @Override public void endAttribute(String qName, StringBuffer textBuffer) { if (this.isIntoMetadatas()) { this.endMetadata(textBuffer); } else if (qName.equals("resource")) { this.endResource(); } else if (qName.equals("metadatas")) { this.setIntoMetadatas(false); } else if (qName.equals(IResourceManager.ALT_METADATA_KEY) || qName.equals(IResourceManager.DESCRIPTION_METADATA_KEY) || qName.equals(IResourceManager.LEGEND_METADATA_KEY) || qName.equals(IResourceManager.TITLE_METADATA_KEY)) { this.endMetadata(qName, textBuffer); } else { super.endAttribute(qName, textBuffer); } }  @Override Object getAttributeHandlerPrototype(); @Override void startAttribute(Attributes attributes, String qName); @Override void endAttribute(String qName, StringBuffer textBuffer); void setResourceManager(IResourceManager resourceManager);  }### Answer:
@Test public void endAttribute_3() throws SAXException { handler.endAttribute("resource", null); Mockito.verify(currentAttr, Mockito.times(0)).setMetadata(ArgumentMatchers.anyString(), ArgumentMatchers.anyString(), ArgumentMatchers.anyString()); Mockito.verify(currentAttr, Mockito.times(0)).setResource(ArgumentMatchers.any(ImageResource.class), ArgumentMatchers.anyString()); }
@Test public void endAttribute_5() throws SAXException { handler.setCurrentLangId("pl"); StringBuffer buffer = new StringBuffer("new text"); handler.endAttribute("text", buffer); Mockito.verify(currentAttr, Mockito.times(1)).setText(ArgumentMatchers.eq("new text"), ArgumentMatchers.eq("pl")); Assert.assertNull(handler.getCurrentLangId()); }