question: public void testMergeOneFilterIntoDocumentWithMultipleFilters ( ) throws Exception { String srcXml = "<web-app>" + "  <filter>" + "    <filter-name>f1</filter-name>" + "    <filter-class>fclass1</filter-class>" + "  </filter>" + "  <filter>" + "    <filter-name>f2</filter-name>" + "    <filter-class>fclass2</filter-class>" + "  </filter>" + "  <filter>" + "    <filter-name>f3</filter-name>" + "    <filter-class>fclass3</filter-class>" + "  </filter>" + "</web-app>" ; WebXml srcWebXml = WebXmlIo . parseWebXml ( new ByteArrayInputStream ( srcXml . getBytes ( "UTF-8" ) ) , null ) ; String mergeXml = "<web-app>" + "  <filter>" + "    <filter-name>f4</filter-name>" + "    <filter-class>fclass4</filter-class>" + "  </filter>" + "</web-app>" ; WebXml mergeWebXml = WebXmlIo . parseWebXml ( new ByteArrayInputStream ( mergeXml . getBytes ( "UTF-8" ) ) , null ) ; WebXmlMerger merger = new WebXmlMerger ( srcWebXml ) ; merger . mergeFilters ( mergeWebXml ) ; List < String > filterNames = WebXmlUtils . getFilterNames ( srcWebXml ) ; assertEquals ( 4 , filterNames . size ( ) ) ; assertEquals ( "f1" , filterNames . get ( 0 ) ) ; assertEquals ( "f2" , filterNames . get ( 1 ) ) ; assertEquals ( "f3" , filterNames . get ( 2 ) ) ; assertEquals ( "f4" , filterNames . get ( 3 ) ) ; }
target:  Tests whether a single filter is correctly merged into a descriptor that already contains multiple other filter definitions.