SAXParserFactory factory = SAXParserFactory.newInstance();
SAXParser saxParser = factory.newSAXParser();
final XMLReader xmlReader = saxParser.getXMLReader();
SAXModelBuilder mb = new SAXModelBuilder();
xmlReader.setContentHandler(mb);
serializer.setOutputCharStream(writer);
serializer.serialize(internalSigXml);
xmlReader.parse(new InputSource(new StringReader(writer.getBuffer().toString())));
InternalSignatureCollection sigs = (InternalSignatureCollection) mb.getModel();
assertEquals(1, sigs.getInternalSignatures().size());
InternalSignature sig = sigs.getInternalSignatures().get(0);
assertEquals(2, sig.getByteSequences().size());
}