code: public static CounterState calculateState(long value, long lowerBound, long upperBound) {
        if (value < lowerBound) {
           return CounterState.LOWER_BOUND_REACHED;
        } else if (value > upperBound) {
           return CounterState.UPPER_BOUND_REACHED;
        }
        return CounterState.VALID;
     }
docs: Calculates the {@link CounterState} to use based on the value and the boundaries.
  <p>
  If the value is less than the lower bound, {@link CounterState#LOWER_BOUND_REACHED} is returned. On other hand, if
  the value is higher than the upper bound, {@link CounterState#UPPER_BOUND_REACHED} is returned. Otherwise, {@link
  CounterState#VALID} is returned.
  
  @param value      the value to check.
  @param lowerBound the lower bound.
  @param upperBound the upper bound.
  @return the {@link CounterState}.