public static Resumed resumed(XmlPullParser parser) throws XmlPullParserException, IOException {
        ParserUtils.assertAtStartTag(parser);
        long h = ParserUtils.getLongAttribute(parser, "h");
        String previd = parser.getAttributeValue("", "previd");
        parser.next();
        ParserUtils.assertAtEndTag(parser);
        return new Resumed(h, previd);
    }
@Test
    public void testParseResumed() throws Exception {
        long handledPackets = 42;
        String previousID = "zid615d9";

        String resumedStanza = XMLBuilder.create("resumed")
                .a("xmlns", "urn:xmpp:sm:3")
                .a("h", String.valueOf(handledPackets))
                .a("previd", previousID)
                .asString(outputProperties);

        StreamManagement.Resumed resumedPacket = ParseStreamManagement.resumed(
                PacketParserUtils.getParserFor(resumedStanza));

        assertNotNull(resumedPacket);
        assertEquals(handledPackets, resumedPacket.getHandledCount());
        assertEquals(previousID, resumedPacket.getPrevId());
    }