ConfigurationParser { public void parseConfiguration(XMLEventReader eventReader) throws XMLStreamException { while (eventReader.hasNext()) { XMLEvent event = eventReader.nextTag(); if (event.isStartElement()) { Configuration configuration = parseConfigElement(eventReader, event); parserDao.persist(configuration); } else if (event.isEndElement()) { return; } } } ConfigurationParser(ConfigurationParserDao parserDao); void parseConfiguration(XMLEventReader eventReader);  }
@Test public void parseConfig() throws XMLStreamException { eventReader.nextTag(); parser.parseConfiguration(eventReader); assertEquals(11, daoValidator.getCount()); }