TracingMessageListener implements MessageListener { static MessageListener create(MessageListener delegate, JmsTracing jmsTracing) { if (delegate == null) return null; if (delegate instanceof TracingMessageListener) return delegate; return new TracingMessageListener(delegate, jmsTracing, true); } TracingMessageListener(MessageListener delegate, JmsTracing jmsTracing, boolean addConsumerSpan); @Override void onMessage(Message message);  }
@Test public void null_listener_if_delegate_is_null() { assertThat(TracingMessageListener.create(null, jmsTracing)) .isNull(); }