### Question:
HugeArrays { static int numberOfPages(long capacity) { final long numPages = (capacity + PAGE_MASK) >>> PAGE_SHIFT; assert numPages <= Integer.MAX_VALUE : "pageSize=" + (PAGE_SIZE) + " is too small for capacity: " + capacity; return (int) numPages; } private  HugeArrays(); static long oversize(long minTargetSize, int bytesPerElement);  }### Answer:
@Test void numberOfPagesForNoData() { assertEquals(0L, numberOfPages(0L)); }
@Test void numberOfPagesForOnePage() { assertEquals(1L, numberOfPages(1L)); assertEquals(1L, numberOfPages(PAGE_SIZE)); }
@Test void numberOfPagesForMorePages() { assertEquals(2L, numberOfPages(PAGE_SIZE + 1L)); assertEquals(2L, numberOfPages(2 * PAGE_SIZE)); }
@Test void numberOfPagesForMaxPages() { assertEquals(Integer.MAX_VALUE, numberOfPages((long) Integer.MAX_VALUE * PAGE_SIZE)); }