    @Test
    public void testParseFailedError() throws Exception {

        StanzaError.Condition errorCondition = StanzaError.Condition.unexpected_request;

        String failedStanza = XMLBuilder.create("failed")
                .a("xmlns", "urn:xmpp:sm:3")
                .element(errorCondition.toString(), StanzaError.ERROR_CONDITION_AND_TEXT_NAMESPACE)
                .asString(outputProperties);

        StreamManagement.Failed failedPacket = ParseStreamManagement.failed(
                PacketParserUtils.getParserFor(failedStanza));

        assertNotNull(failedPacket);
        assertTrue(failedPacket.getStanzaErrorCondition() == errorCondition);
    }