### Question:
OpenTracingTracer implements JmsTracer { @Override public void close() { if (closeUnderlyingTracer) { tracer.close(); } } OpenTracingTracer(Tracer tracer, boolean closeUnderlyingTracer); @Override void initSend(TraceableMessage message, String address); @Override void completeSend(TraceableMessage message, String outcome); @Override void syncReceive(TraceableMessage message, String address, DeliveryOutcome outcome); @Override void asyncDeliveryInit(TraceableMessage message, String address); @Override void asyncDeliveryComplete(TraceableMessage message, DeliveryOutcome outcome, Throwable throwable); @Override void close();  }### Answer:
@Test public void testCreateAndCloseOmitUnderlyingClose() { Tracer mockTracer2 = Mockito.mock(Tracer.class); JmsTracer jmsTracer2 = new OpenTracingTracer(mockTracer2, false); Mockito.verifyNoInteractions(mockTracer2); jmsTracer2.close(); Mockito.verifyNoInteractions(mockTracer2); }
@Test public void testCreateAndClose() { Tracer mockTracer1 = Mockito.mock(Tracer.class); JmsTracer jmsTracer1 = new OpenTracingTracer(mockTracer1, true); Mockito.verifyNoInteractions(mockTracer1); jmsTracer1.close(); Mockito.verify(mockTracer1).close(); Mockito.verifyNoMoreInteractions(mockTracer1); }