code: @Override
     public void setMetricRegistry(Object metricRegistry)
     {
        boolean isAlreadySet = getMetricRegistry() != null;
        super.setMetricRegistry(metricRegistry);
  
        HikariPool p = pool;
        if (p != null) {
           if (isAlreadySet) {
              throw new IllegalStateException("MetricRegistry can only be set one time");
           }
           else {
              p.setMetricRegistry(super.getMetricRegistry());
           }
        }
     }
docs: {@inheritDoc}