code: public double count() {
          T obj2 = ref.get();
          return obj2 != null ? (lastCount = Math.max(countFunction.applyAsLong(obj2), 0)) : lastCount;
      }
docs: The total number of occurrences of the timed event.