### Question:
TrackingLongDoubleHashMap extends LongDoubleHashMap { public static MemoryEstimation memoryEstimation(int pageSize) { return MemoryEstimations .builder(TrackingLongDoubleHashMap.class) .rangePerNode("map buffers", nodeCount -> { long minBufferSize = MemoryUsage.sizeOfEmptyOpenHashContainer(); long maxBufferSize = MemoryUsage.sizeOfOpenHashContainer(Math.min(pageSize, nodeCount)); long min = sizeOfLongArray(minBufferSize) + sizeOfDoubleArray(minBufferSize); long max = sizeOfLongArray(maxBufferSize) + sizeOfDoubleArray(maxBufferSize); return MemoryRange.of(min, max); }) .build(); } TrackingLongDoubleHashMap(AllocationTracker tracker); static MemoryEstimation memoryEstimation(int pageSize); synchronized void synchronizedPut(long key, double value); long free(); @Override void release();  }### Answer:
@Test void shouldComputeMemoryEstimationForSinglePage() { GraphDimensions dimensions = ImmutableGraphDimensions.builder().nodeCount(100).build(); MemoryRange memoryRange = TrackingLongDoubleHashMap .memoryEstimation(4096) .estimate(dimensions, 1) .memoryUsage(); long minBufferSize = 9L; long maxBufferSize = 257; long min = 56 + BitUtil.align(16 + minBufferSize * 8, 8) + BitUtil.align(16 + minBufferSize * 8, 8) ; long max = 56 + BitUtil.align(16 + maxBufferSize * 8, 8) + BitUtil.align(16 + maxBufferSize * 8, 8) ; assertEquals(MemoryRange.of(min, max), memoryRange); }
@Test void shouldComputeMemoryEstimationForMultiplePages() { GraphDimensions dimensions = ImmutableGraphDimensions.builder().nodeCount(100_000).build(); MemoryRange memoryRange = TrackingLongDoubleHashMap .memoryEstimation(4096) .estimate(dimensions, 1) .memoryUsage(); long minBufferSize = 9L; long maxBufferSize = 8193L; long min = 56 + BitUtil.align(16 + minBufferSize * 8, 8) + BitUtil.align(16 + minBufferSize * 8, 8) ; long max = 56 + BitUtil.align(16 + maxBufferSize * 8, 8) + BitUtil.align(16 + maxBufferSize * 8, 8) ; assertEquals(MemoryRange.of(min, max), memoryRange); }