code: public void removeMatching(MetricFilter filter) {
          metrics.entrySet().stream().filter(entry -> filter.matches(entry.getKey(), entry.getValue())).forEachOrdered(entry -> remove(entry.getKey()));
      }
docs: Removes all metrics which match the given filter.
  
  @param filter a filter