public final void tag(I input, ScopedSpan span) {
    if (input == null) throw new NullPointerException("input == null");
    if (span == null) throw new NullPointerException("span == null");
    if (span.isNoop()) return;
    tag(span, input, span.context());
  }
@Test
  public void tag_mutableSpan_threadSafe() throws InterruptedException {
    int numThreads = 1000;
    ExecutorService service = Executors.newFixedThreadPool(numThreads);
    try {
      for (int i = 0; i < numThreads; i++) {
        String val = String.valueOf(i);
        Tag<Object> tag = new Tag<Object>("key" + i) {
          @Override protected String parseValue(Object input, TraceContext context) {
            return val;
          }
        };
        service.submit(() -> tag.tag(input, context, mutableSpan));
      }
    } finally {
      service.shutdown();
      service.awaitTermination(1, TimeUnit.MINUTES);
    }
    assertThat(mutableSpan.tagCount()).isEqualTo(numThreads);
  }