SpanCustomizerShield implements SpanCustomizer { @Override public String toString() { return "SpanCustomizer(" + delegate + ")"; } SpanCustomizerShield(Span delegate); @Override SpanCustomizer name(String name); @Override SpanCustomizer annotate(String value); @Override SpanCustomizer tag(String key, String value); @Override String toString();  }
@Test public void doesNotStackOverflowOnToString() { Span span = tracing.tracer().newTrace(); SpanCustomizerShield shield = new SpanCustomizerShield(span); assertThat(shield.toString()) .isNotEmpty() .isEqualTo("SpanCustomizer(RealSpan(" + span.context().traceIdString() + "/" + span.context() .spanIdString() + "))"); }