@Override public void close() {
    // toArray is synchronized while iterators are not
    pendingScopes.expungeStaleEntries();

    for (Map.Entry<Scope, CallerStackTrace> entry : pendingScopes) {
      CallerStackTrace caller = entry.getValue();
      if (!caller.closed) {
        throwCallerError(caller);
      }
    }
  }
@Test void decorator_close_afterCorrectUsage() {
    try (Scope scope = currentTraceContext.newScope(null)) {
      try (Scope scope2 = currentTraceContext.newScope(context)) {
      }
    }

    decorator.close(); // doesn't error
  }