code: public final V getAndAccumulate(T obj, V x,
                                      BinaryOperator<V> accumulatorFunction) {
          V prev, next;
          do {
              prev = get(obj);
              next = accumulatorFunction.apply(prev, x);
          } while (!compareAndSet(obj, prev, next));
          return prev;
      }
docs: Atomically updates the field of the given object managed by this
  updater with the results of applying the given function to the
  current and given values, 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.  The
  function is applied with the current value as its first argument,
  and the given update as the second argument.
  
  @param obj An object whose field to get and set
  @param x the update value
  @param accumulatorFunction a side-effect-free function of two arguments
  @return the previous value
  @since 1.8