@Test
    public void testSimpleGenerationExample() throws Exception {
        // formulate the result stanza
        final IQ iq = new IQ(IQ.Type.result);
        iq.setFrom("nurse@capulet.lit/chamber");
        iq.setTo("juliet@capulet.lit");
        iq.setID("simpleexample1");

        final Element query = iq.setChildElement("query",
                "http://jabber.org/protocol/disco#info");

        // Consider an entity whose category is "client", whose service
        // discovery type is "pc", service discovery name is "Exodus 0.9.1"
        // (...)
        final Element identity = query.addElement("identity");
        identity.addAttribute("category", "client");
        identity.addAttribute("type", "pc");
        identity.addAttribute("name", "Exodus 0.9.1");

        // (...) and whose supported features are
        // "http://jabber.org/protocol/disco#info",
        // "http://jabber.org/protocol/disco#items",
        // "http://jabber.org/protocol/muc" and
        // "http://jabber.org/protocol/caps"
        query.addElement("feature").addAttribute("var",
                "http://jabber.org/protocol/disco#info");
        query.addElement("feature").addAttribute("var",
                "http://jabber.org/protocol/disco#items");
        query.addElement("feature").addAttribute("var",
                "http://jabber.org/protocol/muc");
        query.addElement("feature").addAttribute("var",
                "http://jabber.org/protocol/caps");

        // Using the SHA-1 algorithm (...)
        final String verification = EntityCapabilitiesManager.generateVerHash(
                iq, "sha-1");

        // the verification string result must be QgayPKawpkPSDYmwT/WM94uAlu0=
        assertEquals("QgayPKawpkPSDYmwT/WM94uAlu0=", verification);
    }
Tests the CAPS verification string generation based on the
"Simple Generation Example" provided in section 5.2 of XEP-0115 (version
1.4 and later).
xmppserver/src/test/java/org/jivesoftware/util/EntityCapabilitiesManagerTest.java