@Test
    public void testPrioritizedTemplate() throws Exception
    {
        // Setup fixture.
        final Document input;
        try ( final InputStream stream = getClass().getResourceAsStream("/org/jivesoftware/openfire/ldap/vcardmapping-prioritized.xml" ) )
        {
            SAXReader reader = new SAXReader();
            input = reader.read(stream);
        }

        // Execute system under test.
        final LdapVCardProvider.VCardTemplate result = new LdapVCardProvider.VCardTemplate(input);

        // Verify result.
        assertNotNull( result );
        assertTrue( Arrays.asList( result.getAttributes() ).contains( "jpegPhoto" ) );
        assertTrue( Arrays.asList( result.getAttributes() ).contains( "st" ) );
        assertTrue( Arrays.asList( result.getAttributes() ).contains( "telephoneNumber" ) );
        assertTrue( Arrays.asList( result.getAttributes() ).contains( "mail" ) );
        assertTrue( Arrays.asList( result.getAttributes() ).contains( "fullName" ) );
        assertTrue( Arrays.asList( result.getAttributes() ).contains( "givenName" ) );
        assertTrue( Arrays.asList( result.getAttributes() ).contains( "postalCode" ) );
        assertTrue( Arrays.asList( result.getAttributes() ).contains( "homePhone" ) );
        assertTrue( Arrays.asList( result.getAttributes() ).contains( "mobile" ) );
        assertTrue( Arrays.asList( result.getAttributes() ).contains( "cn" ) );
        assertTrue( Arrays.asList( result.getAttributes() ).contains( "l" ) );
        assertTrue( Arrays.asList( result.getAttributes() ).contains( "title" ) );
        assertTrue( Arrays.asList( result.getAttributes() ).contains( "homePostalAddress" ) );
        assertTrue( Arrays.asList( result.getAttributes() ).contains( "uid" ) );
        assertTrue( Arrays.asList( result.getAttributes() ).contains( "postalAddress" ) );
        assertTrue( Arrays.asList( result.getAttributes() ).contains( "pager" ) );
        assertTrue( Arrays.asList( result.getAttributes() ).contains( "departmentNumber" ) );
        assertEquals( 17, result.getAttributes().length );
    }
Verifies that all placeholder gets correctly identified in the full, default VCardTemplate that has been
modified to have one element that uses a combination of more than one placeholder in the format that uses the
first non-empty placeholder that's available.

@see <a href="https://igniterealtime.atlassian.net/browse/OF-1106">OF-1106</a>
xmppserver/src/test/java/org/jivesoftware/openfire/ldap/VCardTemplateTest.java