@Test
    public void testInvalidChainCAnotTrusted() throws Exception
    {
        // Setup fixture.

        // Execute system under test.
        assertThrows(CertificateException.class, () -> systemUnderTest.checkClientTrusted( untrustedCAChain, "RSA" ) );
    }
Verifies that a chain that is valid, but does not have its root CA certificate in the trust store, is rejected.
xmppserver/src/test/java/org/jivesoftware/openfire/keystore/OpenfireX509TrustManagerTest.java