### Question:
HugeSparseLongArray { public boolean contains(long index) { final int pageIndex = pageIndex(index); if (pageIndex < pages.length) { long[] page = pages[pageIndex]; if (page != null) { return page[indexInPage(index)] != defaultValue; } } return false; } private  HugeSparseLongArray(long capacity, long[][] pages, long defaultValue); static MemoryRange memoryEstimation(long maxId, long maxEntries); long getCapacity(); long get(long index); boolean contains(long index);  }### Answer:
@Test void shouldHaveContains() { HugeSparseLongArray.Builder array = HugeSparseLongArray.Builder.create(10, AllocationTracker.empty()); int index = integer(2, 8); int value = integer(42, 1337); array.set(index, value); HugeSparseLongArray longArray = array.build(); for (int i = 0; i < 10; i++) { if (i == index) { assertTrue(longArray.contains(i), "Expected index " + i + " to be contained, but it was not"); } else { assertFalse(longArray.contains(i), "Expected index " + i + " not to be contained, but it actually was"); } } }