code: public int getAndSetHi(int hi) {
          while (true) {
              long encoded = get();
              long update = encodeHi(encoded, hi);
              if (compareAndSet(encoded, update))
                  return getHi(encoded);
          }
      }
docs: Atomically sets the hi value without changing the lo value.
  
  @param hi the new hi value
  @return the previous hi value