code: public void finishSpan() {
          TraceState ts = traceState.get();
  
          if (ts != null) {
              Span span = ts.popSpan();
              if (log.isLoggable(Level.FINEST)) {
                  log.finest("Finish span = " + span + " trace state = " + ts);
              }
  
              span.finish();
  
              if (ts.isFinished()) {
                  if (log.isLoggable(Level.FINEST)) {
                      log.finest("Remove trace state = " + ts);
                  }
                  traceState.remove();
              }
          } else if (log.isLoggable(Level.FINEST)) {
              log.finest("Finish span requested but no trace state");
          }
      }
docs: This method calls the 'finish()' method on the current span.