code: public final double getAndSet(int i, double newValue) {
      long next = doubleToRawLongBits(newValue);
      return longBitsToDouble(longs.getAndSet(i, next));
    }
docs: Atomically sets the element at position {@code i} to the given value and returns the old value.
  
  @param i the index
  @param newValue the new value
  @return the previous value