@Test
    public void test_GetNamespacesOnCurrentElement_MixedNamespace_WithChildElement() throws Exception
    {
        // Setup test fixture.
        packetReader.getXPPParser().resetInput();
        final String input = "<stream xmlns='custom:default:namespace' xmlns:xmpp='jabber:client' xmlns:unittest='custom:namespace'>" +
            "  <child xmlns:foo='bar'/>" +
            "</stream>";

        packetReader.getXPPParser().setInput(new StringReader(input));
        int type;
        do { // Progress parsing to the root element.
            type = packetReader.getXPPParser().next();
        } while (type != XmlPullParser.START_TAG || !"stream".equals(packetReader.getXPPParser().getName()));

        // Execute system under test.
        final Set<Namespace> namespacesOnCurrentElement = XMPPPacketReader.getPrefixedNamespacesOnCurrentElement(packetReader.getXPPParser());

        // Verify results.
        assertEquals(1, namespacesOnCurrentElement.size());
        assertEquals(Namespace.get("unittest", "custom:namespace"), namespacesOnCurrentElement.iterator().next());
    }
Verify that {@link XMPPPacketReader#getPrefixedNamespacesOnCurrentElement(XmlPullParser)} does not return data
that is declared on a child element of the element that the parser is currently on.
xmppserver/src/test/java/dom/io/XMPPPacketReaderTest.java