### Question:
SpiffeTrustManagerFactory extends TrustManagerFactorySpi { public TrustManager[] engineGetTrustManagersAcceptAnySpiffeId(@NonNull final BundleSource<X509Bundle> x509BundleSource) { val spiffeTrustManager = new SpiffeTrustManager(x509BundleSource); return new TrustManager[]{spiffeTrustManager}; }  @Override TrustManager[] engineGetTrustManagers(); TrustManager[] engineGetTrustManagers(@NonNull final BundleSource<X509Bundle> x509BundleSource); TrustManager[] engineGetTrustManagersAcceptAnySpiffeId(@NonNull final BundleSource<X509Bundle> x509BundleSource); TrustManager[] engineGetTrustManagers(
            @NonNull final BundleSource<X509Bundle> x509BundleSource,
            @NonNull final Supplier<Set<SpiffeId>> acceptedSpiffeIdsSupplier);  }### Answer:
@Test void engineGetTrustManagersAcceptAnySpiffeId() throws NoSuchFieldException, IllegalAccessException { X509Source source = new X509SourceStub(); TrustManager[] trustManagers = new SpiffeTrustManagerFactory().engineGetTrustManagersAcceptAnySpiffeId(source); SpiffeTrustManager trustManager = (SpiffeTrustManager) trustManagers[0]; boolean acceptAny = isAcceptAny(trustManager); assertTrue(acceptAny); }
@Test void engineGetTrustManagersAcceptAnySpiffeId_nullParameter() { try { new SpiffeTrustManagerFactory().engineGetTrustManagersAcceptAnySpiffeId(null); } catch (NullPointerException e) { assertEquals("x509BundleSource is marked non-null but is null", e.getMessage()); } }