code: protected void removedMetricContext(InnerMetricContext context) {
      this.contextsToReport.remove(context);
      if (context.getParent().isPresent() && this.contextFilter.shouldReplaceByParent(context)) {
        this.contextsToReport.add(context.getParent().get().getInnerMetricContext());
      }
    }
docs: Called when any {@link MetricContext} is removed from the tree.
  
  @param context {@link InnerMetricContext} backing the removed {@link MetricContext}.