@Test( expected = RuntimeException.class )
    public void testEmptyChainArgument() throws Exception
    {
        // Setup fixture.
        final CertSelector selector = new X509CertSelector();
        final X509Certificate[] chain = new X509Certificate[0];

        // Execute system under test.
        trustManager.checkChainTrusted( selector, chain );

        // Verify results
        // (verified by 'expected' parameter of @Test annotation).
    }
Verifies that providing an empty array for the first argument causes a runtime exception to be thrown.
xmppserver/src/test/java/org/jivesoftware/openfire/keystore/CheckChainTrustedTest.java