@Test
    public void testFilterValidWithTwoDistinctInvalidCerts() throws Exception
    {
        // Setup fixture.
        final X509Certificate invalidA = KeystoreTestUtils.generateExpiredCertificate().getCertificate();
        final X509Certificate invalidB = KeystoreTestUtils.generateExpiredCertificate().getCertificate();
        final Collection<X509Certificate> input = new ArrayList<>();
        input.add( invalidA );
        input.add( invalidB );

        // Execute system under test.
        final Collection<X509Certificate> result = CertificateUtils.filterValid( input );

        // Verify results.
        assertTrue( result.isEmpty() );
    }
Test for {@link CertificateUtils#filterValid(Collection)}. Verifies that an input argument that
contains two distinct, invalid certificate returns a collection that is empty.
xmppserver/src/test/java/org/jivesoftware/openfire/keystore/CertificateUtilsTest.java