### Question:
X509BundleSet implements BundleSource<X509Bundle> { public static X509BundleSet of(@NonNull final Collection<X509Bundle> bundles) { if (bundles.size() == 0) { throw new IllegalArgumentException("X509Bundles collection is empty"); } final Map<TrustDomain, X509Bundle> bundleMap = new ConcurrentHashMap<>(); for (X509Bundle bundle : bundles) { bundleMap.put(bundle.getTrustDomain(), bundle); } return new X509BundleSet(bundleMap); } private  X509BundleSet(final Map<TrustDomain, X509Bundle> bundles); private  X509BundleSet(); static X509BundleSet of(@NonNull final Collection<X509Bundle> bundles); static X509BundleSet emptySet(); void put(@NonNull final X509Bundle x509Bundle); @Override X509Bundle getBundleForTrustDomain(@NonNull final TrustDomain trustDomain); Map<TrustDomain, X509Bundle> getBundles();  }### Answer:
@Test void testOf_null_throwsNullPointerException() { try { X509BundleSet.of(null); fail("should have thrown exception"); } catch (NullPointerException e) { assertEquals("bundles is marked non-null but is null", e.getMessage()); } }
@Test void testOf_emptyCollection_throwsIllegalArgumentException() { try { X509BundleSet.of(Collections.emptyList()); fail("should have thrown exception"); } catch (IllegalArgumentException e) { assertEquals("X509Bundles collection is empty", e.getMessage()); } }