JaegerTracer implements Tracer, Closeable { @Override public void close() { reporter.close(); sampler.close(); if (shutdownHook != null) { Runtime.getRuntime().removeShutdownHook(shutdownHook); } } protected  JaegerTracer(JaegerTracer.Builder builder); String getVersion(); Metrics getMetrics(); String getServiceName(); Map<String, ?> tags(); int getIpv4(); @Override ScopeManager scopeManager(); @Override Span activeSpan(); @Override JaegerTracer.SpanBuilder buildSpan(String operationName); @Override void inject(SpanContext spanContext, Format<T> format, T carrier); @Override JaegerSpanContext extract(Format<T> format, T carrier); @Override void close(); static String getVersionFromProperties(); boolean isUseTraceId128Bit(); @Override Scope activateSpan(Span span);  }
@Test public void testClose() { Reporter reporter = mock(Reporter.class); Sampler sampler = mock(Sampler.class); tracer = new JaegerTracer.Builder("bonda") .withReporter(reporter) .withSampler(sampler) .build(); tracer.close(); verify(reporter).close(); verify(sampler).close(); }