@Test
    public void testServerIdentitiesCommonNameOnly() throws Exception
    {
        // Setup fixture.
        final String subjectCommonName = "MySubjectCommonName";

        final X509v3CertificateBuilder builder = new JcaX509v3CertificateBuilder(
                new X500Name( "CN=MyIssuer" ),                          // Issuer
                BigInteger.valueOf( Math.abs( new SecureRandom().nextInt() ) ), // Random serial number
                Date.from( Instant.now().plus(Duration.ofDays(30)) ),           // Not before 30 days ago
                Date.from( Instant.now().minus(Duration.ofDays(99)) ),          // Not after 99 days from now
                new X500Name( "CN=" + subjectCommonName ),              // Subject
                subjectKeyPair.getPublic()
        );

        final X509CertificateHolder certificateHolder = builder.build( contentSigner );
        final X509Certificate cert = new JcaX509CertificateConverter().getCertificate( certificateHolder );

        // Execute system under test
        final List<String> serverIdentities = CertificateManager.getServerIdentities( cert );

        // Verify result
        assertEquals( 1, serverIdentities.size() );
        assertEquals( subjectCommonName, serverIdentities.get( 0 ) );
    }
{@link CertificateManager#getServerIdentities(X509Certificate)} should return:
<ul>
    <li>the Common Name</li>
</ul>

when a certificate contains:
<ul>
    <li>no other identifiers than its CommonName</li>
</ul>
xmppserver/src/test/java/org/jivesoftware/util/CertificateManagerTest.java