LOG.info(defaultEchoService.echo("Hello explicitly resolved CDI bean!"));
defaultEchoService = BeanProvider.getContextualReference("defaultEchoService", false, EchoService.class);
LOG.info(defaultEchoService.echo("Hello CDI bean resolved by name!"));
OptionalService optionalService = BeanProvider.getContextualReference(OptionalService.class, true);
if (optionalService == null)
{