MetadataFromSignal implements Supplier<Metadata> { public static MetadataFromSignal of(final Signal<?> signal, final WithOptionalEntity withOptionalEntity, @Nullable final Metadata existingMetadata) { return new MetadataFromSignal(checkNotNull(signal, "signal"), checkNotNull(withOptionalEntity, "withOptionalEntity"), existingMetadata); } private  MetadataFromSignal(final Signal<?> signal, final WithOptionalEntity withOptionalEntity,
            @Nullable final Metadata existingMetadata); static MetadataFromSignal of(final Signal<?> signal,
            final WithOptionalEntity withOptionalEntity,
            @Nullable final Metadata existingMetadata); @Override @Nullable Metadata get();  }
@Test public void tryToGetInstanceWithNullCommand() { assertThatNullPointerException() .isThrownBy(() -> MetadataFromSignal.of(null, null, entity.getMetadata().orElse(null))) .withMessage("The signal must not be null!") .withNoCause(); }