code: private static <T extends Number> void addIfPresent(Map<String, ValueStatistic<?>> knownStatistics, String name, OperationStatistic<?> reference, Supplier<T> valueSupplier) {
      if(!(reference instanceof ZeroOperationStatistic)) {
        knownStatistics.put(name, counter(valueSupplier));
      }
    }
docs: Add the statistic as a known statistic only if the reference statistic is available. We consider that the reference statistic can only be
  an instance of {@code ZeroOperationStatistic} when statistics are disabled.
  
  @param knownStatistics map of known statistics
  @param name the name of the statistic to add
  @param reference the reference statistic that should be available for the statistic to be added
  @param valueSupplier the supplier that will provide the current value for the statistic
  @param <T> type of the supplied value