### Question:
AtomicDouble extends Number { public double addAndGet(double amount) { long v; double d; double n; long next; do { v = value.get(); d = Double.longBitsToDouble(v); n = d + amount; next = Double.doubleToLongBits(n); } while (!value.compareAndSet(v, next)); return n; } AtomicDouble();  AtomicDouble(double init); double get(); double addAndGet(double amount); double getAndAdd(double amount); double getAndSet(double amount); boolean compareAndSet(double expect, double update); void set(double amount); void max(double v); @Override int intValue(); @Override long longValue(); @Override float floatValue(); @Override double doubleValue();  }### Answer:
@Test public void addAndGet() { AtomicDouble v = new AtomicDouble(13.0); Assertions.assertEquals(55.0, v.addAndGet(42.0), 1e-12); Assertions.assertEquals(55.0, v.get(), 1e-12); }