question: private boolean tryIncrement ( AtomicInteger counter , int max ) { while ( true ) { int count = counter . get ( ) ; if ( count >= max && max != 0 ) return false ; if ( counter . compareAndSet ( count , count + 1 ) ) return true ; } }
target:  Attempts to increment the given AtomicInteger without exceeding the specified maximum value. If the AtomicInteger cannot be incremented without exceeding the maximum, false is returned.