code: public T getAndSet(T value) {
          T t = this.value;
          this.value = value;
          return t;
      }
docs: Replaces this references value with the given one.
  
  @param value the new value
  @return the previous value