### Question:
HugeLongArray extends HugeArray<long[], Long, HugeLongArray> { public static long memoryEstimation(long size) { assert size >= 0; if (size <= ArrayUtil.MAX_ARRAY_LENGTH) { return sizeOfInstance(SingleHugeLongArray.class) + sizeOfLongArray((int)size); } long sizeOfInstance = sizeOfInstance(PagedHugeLongArray.class); int numPages = numberOfPages(size); long memoryUsed = sizeOfObjectArray(numPages); final long pageBytes = sizeOfLongArray(PAGE_SIZE); memoryUsed += (numPages - 1) * pageBytes; final int lastPageSize = exclusiveIndexOfPage(size); return sizeOfInstance + memoryUsed + sizeOfLongArray(lastPageSize); }  abstract long get(long index); abstract void set(long index, long value); abstract void or(long index, final long value); abstract long and(long index, final long value); abstract void addTo(long index, long value); abstract void setAll(LongUnaryOperator gen); abstract void fill(long value); @Override abstract long size(); @Override abstract long sizeOf(); abstract long binarySearch(long searchValue); @Override abstract long release(); @Override abstract HugeCursor<long[]> newCursor(); @Override abstract void copyTo(final HugeLongArray dest, final long length); @Override final HugeLongArray copyOf(final long newLength, final AllocationTracker tracker); @Override long[] toArray(); @Override LongNodeProperties asNodeProperties(); static HugeLongArray newArray(long size, AllocationTracker tracker); static long memoryEstimation(long size); static HugeLongArray of(final long... values);  }### Answer:
@Test void shouldComputeMemoryEstimation() { assertEquals(40, HugeLongArray.memoryEstimation(0L)); assertEquals(840, HugeLongArray.memoryEstimation(100L)); assertEquals(800_122_070_368L, HugeLongArray.memoryEstimation(100_000_000_000L)); }
@Test void shouldFailForNegativeMemRecSize() { assertThrows(AssertionError.class, () -> HugeLongArray.memoryEstimation(-1L)); }