code: public static CounterValue newCounterValue(long value, long lowerBound, long upperBound) {
        return new CounterValue(value, calculateState(value, lowerBound, upperBound));
     }
docs: Creates a new {@link CounterValue} with the value and state based on the boundaries.
  
  @param value      the counter's value.
  @param lowerBound the counter's lower bound.
  @param upperBound the counter's upper bound.
  @return the {@link CounterValue}.