### Question:
HugeAtomicLongArray { public static long memoryEstimation(long size) { assert size >= 0; long instanceSize; long dataSize; if (size <= ArrayUtil.MAX_ARRAY_LENGTH) { instanceSize = sizeOfInstance(SingleHugeAtomicLongArray.class); dataSize = sizeOfLongArray((int) size); } else { instanceSize = sizeOfInstance(PagedHugeAtomicLongArray.class); dataSize = PagedHugeAtomicLongArray.memoryUsageOfData(size); } return instanceSize + dataSize; }  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 shouldComputeMemoryEstimation() { assertEquals(40, HugeAtomicLongArray.memoryEstimation(0L)); assertEquals(840, HugeAtomicLongArray.memoryEstimation(100L)); assertEquals(800_122_070_368L, HugeAtomicLongArray.memoryEstimation(100_000_000_000L)); }
@Test void shouldFailForNegativeMemRecSize() { assertThrows(AssertionError.class, () -> HugeAtomicLongArray.memoryEstimation(-1L)); }