### Question:
SmartJniMemoryManager extends JniMemoryManager { @Override @Contract(pure = true) public long getPageSize() { return pageSize = super.getPageSize(); } private  SmartJniMemoryManager(); @Override @Contract(pure = true) long getPageSize(); @Override @Contract(pure = true) @SuppressWarnings("PMD.DataflowAnomalyAnalysis") long getHugepageSize(); @Override @Contract(pure = true) @SuppressWarnings("PMD.DataflowAnomalyAnalysis") @SuppressFBWarnings("RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE") long virt2phys(final long address);  }### Answer:
@Test @DisplayName("getPageSize()") void getPageSize() { assumeTrue(mmanager != null); val pageSize = mmanager.getPageSize(); assertThat(pageSize).isPositive().withFailMessage("should be a power of two").isEqualTo(pageSize & -pageSize); }
@Test @DisplayName("dmaAllocate(long, boolean, boolean)") void dmaAllocate() { assumeTrue(mmanager != null); for (val huge : Arrays.asList(false, true)) { for (val lock : Arrays.asList(false, true)) { val bytes = createSize(0xFFFF); val dma = mmanager.dmaAllocate(bytes, huge, lock); val softly = new SoftAssertions(); softly.assertThat(dma.getPhysical()).isNotZero(); softly.assertThat(dma.getPhysical() & (mmanager.getPageSize() - 1)) .isEqualTo(dma.getVirtual() & (mmanager.getPageSize() - 1)); mmanager.free(dma.getVirtual(), bytes, huge, lock); softly.assertAll(); } } }