@Test
    public void testFilterValidWithTwoDistinctValidCerts() throws Exception
    {
        // Setup fixture.
        final X509Certificate validA = KeystoreTestUtils.generateValidCertificate().getCertificate();
        final X509Certificate validB = KeystoreTestUtils.generateValidCertificate().getCertificate();
        final Collection<X509Certificate> input = new ArrayList<>();
        input.add( validA );
        input.add( validB );

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

        // Verify results.
        assertEquals( 2, result.size() );
        assertTrue( result.contains( validA ) );
        assertTrue( result.contains( validB ) );
    }
Test for {@link CertificateUtils#filterValid(Collection)}. Verifies that an input argument that
contains two distinct, valid certificates returns a collection that contains both certificates.
xmppserver/src/test/java/org/jivesoftware/openfire/keystore/CertificateUtilsTest.java