@Test
    public void testAllUserListener() throws Exception
    {
        // Setup fixture.
        final JID entity = new JID( "john", "example.org", "mobile" );
        final EntityCapabilities caps = new EntityCapabilities();
        caps.setVerAttribute( "test-ver" );
        caps.setHashAttribute( "test-hash" );
        caps.addFeature( "test-feature" );
        caps.addIdentity( "test-identity" );
        manager.addListener( allUsers );

        // Execute system under test.
        manager.registerCapabilities( entity, caps );

        // Verify results.
        verify( allUsers, times(1) ).entityCapabilitiesChanged( entity, caps, caps.getFeatures(), Collections.emptySet(), caps.getIdentities(), Collections.emptySet() );
    }
Asserts that registering a all-user listener causes that listener to receive an event once that's generated.
xmppserver/src/test/java/org/jivesoftware/openfire/entitycaps/EntityCapabilitiesListenerTest.java