### Question:
DefaultSmsSenderProvider implements SmsSenderProvider { @Override public Optional<TemplatedSmsSender> lookupTemplatedSmsMessageSenderFor(final String providerType) { assertValidProviderTypeArgument(providerType); return Optional.ofNullable(registeredTemplatedSmsSender.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 testLookupTemplatedSmsMessageSenderFor() { assertThatThrownBy(() -> smsSenderProvider.lookupTemplatedSmsMessageSenderFor(null)) .isInstanceOf(IllegalArgumentException.class); assertThatThrownBy(() -> smsSenderProvider.lookupTemplatedSmsMessageSenderFor("")) .isInstanceOf(IllegalArgumentException.class); }
@Test public void testLookupTemplatedSmsMessageSenderForrMissing() { assertThat(smsSenderProvider.lookupTemplatedSmsMessageSenderFor(templatedSmsSenderRegistry.name() + "_test")) .isEmpty(); }
@Test public void testLookupTemplatedSmsMessageSenderForPresent() { assertThat(smsSenderProvider.lookupTemplatedSmsMessageSenderFor(templatedSmsSenderRegistry.name())) .isPresent() .contains(templatedSmsSenderRegistry.sender()); }