V put(K k, Supplier<V> supplier) {
    return map.compute(
            k, (k1, old) -> old != null ? old : new RefCountingMap.Payload<>(supplier.get()))
        .increment();
  }
A map of K to V, but does ref counting for added and removed values. The values are not added
directly, but instead requested from the given Supplier if ref count == 0. Each put() call will
increment the ref count, and each remove() will decrement it. The values are removed from the map
iff ref count == 0.
iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/ratis/metrics/RefCountingMap.java