### Question:
DefaultSmsSenderProvider implements SmsSenderProvider { @Override public Optional<SimpleSmsSender> lookupSimpleSmsMessageSenderFor(final String providerType) { assertValidProviderTypeArgument(providerType); return Optional.ofNullable(registeredSimpleSmsSenders.get(providerType)); } DefaultSmsSenderProvider(final List<SimpleSmsSenderRegistry> simpleSmsSenderRegistries,
                             final List<TemplatedSmsSenderRegistry> templatedSmsSenderRegistries); @Override Optional<SimpleSmsSender> lookupSimpleSmsMessageSenderFor(final String providerType); @Override Optional<TemplatedSmsSender> lookupTemplatedSmsMessageSenderFor(final String providerType);  }### Answer:
@Test public void testLookupSimpleSmsMessageSenderFor() { assertThatThrownBy(() -> smsSenderProvider.lookupSimpleSmsMessageSenderFor(null)) .isInstanceOf(IllegalArgumentException.class); assertThatThrownBy(() -> smsSenderProvider.lookupSimpleSmsMessageSenderFor("")) .isInstanceOf(IllegalArgumentException.class); }
@Test public void testLookupSimpleSmsMessageSenderForMissing() { assertThat(smsSenderProvider.lookupSimpleSmsMessageSenderFor(simpleSmsSenderRegistry.name() + "_test")) .isEmpty(); }
@Test public void testLookupSimpleSmsMessageSenderForPresent() { assertThat(smsSenderProvider.lookupSimpleSmsMessageSenderFor(simpleSmsSenderRegistry.name())) .isPresent() .contains(simpleSmsSenderRegistry.sender()); }