### Question:
OpenfireX509TrustManager implements X509TrustManager { @Override public X509Certificate[] getAcceptedIssuers() { final Set<X509Certificate> result; if ( checkValidity ) { result = CertificateUtils.filterValid( this.trustedIssuers ); } else { result = this.trustedIssuers; } return result.toArray( new X509Certificate[ result.size() ] ); } OpenfireX509TrustManager( KeyStore trustStore, boolean acceptSelfSigned, boolean checkValidity ); @Override void checkClientTrusted( X509Certificate[] chain, String authType ); @Override void checkServerTrusted( X509Certificate[] chain, String authType ); @Override X509Certificate[] getAcceptedIssuers();  }### Answer:
@Test public void testAcceptedIssuersAreAllValid() throws Exception { final X509Certificate[] result = systemUnderTest.getAcceptedIssuers(); Assert.assertEquals( 2, result.length ); Assert.assertTrue( Arrays.asList( result ).contains( getLast( validChain ) ) ); Assert.assertTrue( Arrays.asList( result ).contains( getLast( expiredIntChain ) ) ); Assert.assertFalse( Arrays.asList( result ).contains( getLast( expiredRootChain ) ) ); }