### Question:
X509Bundle implements BundleSource<X509Bundle> { public static X509Bundle load(@NonNull final TrustDomain trustDomain, @NonNull final Path bundlePath) throws X509BundleException { final byte[] bundleBytes; try { bundleBytes = Files.readAllBytes(bundlePath); } catch (IOException e) { throw new X509BundleException("Unable to load X.509 bundle file", e); } val x509Certificates = generateX509Certificates(bundleBytes); val x509CertificateSet = new HashSet<>(x509Certificates); return new X509Bundle(trustDomain, x509CertificateSet); } X509Bundle(@NonNull final TrustDomain trustDomain);  X509Bundle(@NonNull final TrustDomain trustDomain, @NonNull final Set<X509Certificate> x509Authorities); static X509Bundle load(@NonNull final TrustDomain trustDomain, @NonNull final Path bundlePath); static X509Bundle parse(@NonNull final TrustDomain trustDomain, @NonNull final byte[] bundleBytes); @Override X509Bundle getBundleForTrustDomain(@NonNull final TrustDomain trustDomain); Set<X509Certificate> getX509Authorities(); boolean hasX509Authority(@NonNull final X509Certificate x509Authority); void addX509Authority(@NonNull final X509Certificate x509Authority); void removeX509Authority(@NonNull final X509Certificate x509Authority);  }### Answer:
@Test void TestLoad_Fails() { try { X509Bundle.load(TrustDomain.of("example.org"), Paths.get("testdata/x509bundle/non-existent.pem")); fail("should have thrown exception"); } catch (X509BundleException e) { assertEquals("Unable to load X.509 bundle file", e.getMessage()); } }
@Test void testLoad_nullTrustDomain_throwsNullPointerException() throws X509BundleException { try { X509Bundle.load(null,Paths.get("testdata/x509bundle/non-existent.pem")); fail("should have thrown exception"); } catch (NullPointerException e) { assertEquals("trustDomain is marked non-null but is null", e.getMessage()); } }
@Test void testLoad_nullBundlePath_throwsNullPointerException() throws X509BundleException { try { X509Bundle.load(TrustDomain.of("example.org"), null); fail("should have thrown exception"); } catch (NullPointerException e) { assertEquals("bundlePath is marked non-null but is null", e.getMessage()); } }