@Override
    public X509Certificate[] getAcceptedIssuers()
    {
        final Set<X509Certificate> result;
        if ( checkValidity )
        {
            // Filter the set of issuers to see what certificates are currently valid. Note that this might result in a
            // different result as compared with the last verification.
            result = CertificateUtils.filterValid( this.trustedIssuers );
        }
        else
        {
            result = this.trustedIssuers;
        }
        return result.toArray( new X509Certificate[ result.size() ] );
    }
@Test
    public void testAcceptedIssuersAreAllValid() throws Exception
    {
        // Setup fixture.

        // Execute system under test.
        final X509Certificate[] result = systemUnderTest.getAcceptedIssuers();

        // Verify results.
        assertEquals( 2, result.length );
        assertTrue( Arrays.asList( result ).contains( getLast( validChain ) ) );
        assertTrue( Arrays.asList( result ).contains( getLast( expiredIntChain ) ) );
        assertFalse( Arrays.asList( result ).contains( getLast( expiredRootChain ) ) );
    }