code: public final long getAndUpdate(int i, LongUnaryOperator updateFunction) {
          // long offset = checkedByteOffset(i);
          long prev, next;
          do {
              prev = get(i);
              next = updateFunction.applyAsLong(prev);
          } while (!compareAndSet(i, prev, next));
          return prev;
      }
docs: Atomically updates the element at index {@code i} with the results
  of applying the given function, returning the previous value. The
  function should be side-effect-free, since it may be re-applied
  when attempted updates fail due to contention among threads.
  
  @param i the index
  @param updateFunction a side-effect-free function
  @return the previous value
  @since 1.8