### Question:
SpiffeId { public static SpiffeId of(@NonNull final TrustDomain trustDomain, final String... segments) { val path = Arrays.stream(segments) .filter(StringUtils::isNotBlank) .map(SpiffeId::normalize) .map(s -> '/' + s) .collect(Collectors.joining()); return new SpiffeId(trustDomain, path); } private  SpiffeId(final TrustDomain trustDomain, final String path); static SpiffeId of(@NonNull final TrustDomain trustDomain, final String... segments); static SpiffeId parse(final String spiffeIdAsString); boolean memberOf(final TrustDomain trustDomain); @Override String toString(); static final String SPIFFE_SCHEME; }### Answer:
@Test void of_NullTrustDomain_throwsException() { try { SpiffeId.of(null); } catch (NullPointerException e) { assertEquals("trustDomain is marked non-null but is null", e.getMessage()); } }