### Question:
HugeAtomicLongArray { public abstract boolean compareAndSet(long index, long expect, long update);  abstract long get(long index); abstract void set(long index, long value); abstract boolean compareAndSet(long index, long expect, long update); abstract long compareAndExchange(long index, long expect, long update); abstract void update(long index, LongUnaryOperator updateFunction); abstract long size(); abstract long sizeOf(); abstract void setAll(long value); abstract long release(); LongNodeProperties asNodeProperties(); static HugeAtomicLongArray newArray(long size, AllocationTracker tracker); static HugeAtomicLongArray newArray(long size, LongPageCreator pageFiller, AllocationTracker tracker); static long memoryEstimation(long size);  }### Answer:
@Test void testCompareAndSet() { testArray(SIZE, aa -> { for (int i = 0; i < SIZE; i++) { aa.set(i, 1); assertTrue(aa.compareAndSet(i, 1, 2)); assertTrue(aa.compareAndSet(i, 2, -4)); assertEquals(-4, aa.get(i)); assertFalse(aa.compareAndSet(i, -5, 7)); assertEquals(-4, aa.get(i)); assertTrue(aa.compareAndSet(i, -4, 7)); assertEquals(7, aa.get(i)); } }); }