code: public long getAndIncrement(T obj) {
          long prev, next;
          do {
              prev = get(obj);
              next = prev + 1;
          } while (!compareAndSet(obj, prev, next));
          return prev;
      }
docs: Atomically increments by one the current value of the field of the
  given object managed by this updater.
  
  @param obj An object whose field to get and set
  @return the previous value