### Question:
JniMemoryManager implements MemoryManager { @Override @Contract(pure = true) public long virt2phys(final long address) { if (!OPTIMIZED && address == 0) throw new IllegalArgumentException("The parameter 'address' MUST NOT be 0."); if (DEBUG >= LOG_TRACE) log.trace("Translating virtual address 0x{} to physical address.", leftPad(address)); return c_virt2phys(address); } @SuppressWarnings("ResultOfMethodCallIgnored")  JniMemoryManager(); @Override @Contract(pure = true) boolean isValid(); @Override @Contract(pure = true) int getAddressSize(); @Override @Contract(pure = true) long getPageSize(); @Override @Contract(pure = true) long getHugepageSize(); @Override @Contract(pure = true) @SuppressWarnings("BooleanParameter") long allocate(long bytes, final boolean huge, final boolean lock); @Override @SuppressWarnings("BooleanParameter") void free(long address, long bytes, final boolean huge, final boolean lock); @Override @Contract(pure = true) @SuppressWarnings({"BooleanParameter", "IOResourceOpenedButNotSafelyClosed", "resource"}) long mmap(final @NotNull File file, final boolean huge, final boolean lock); @Override @SuppressWarnings("BooleanParameter") void munmap(final long address, final @NotNull File file, final boolean huge, final boolean lock); @Override @Contract(pure = true) byte getByte(final long address); @Override @Contract(pure = true) short getShort(final long address); @Override @Contract(pure = true) int getInt(final long address); @Override @Contract(pure = true) long getLong(final long address); @Override @Contract(pure = true) byte getByteVolatile(final long address); @Override @Contract(pure = true) short getShortVolatile(final long address); @Override @Contract(pure = true) int getIntVolatile(final long address); @Override @Contract(pure = true) long getLongVolatile(final long address); @Override void putByte(final long address, final byte value); @Override void putShort(final long address, final short value); @Override void putInt(final long address, final int value); @Override void putLong(final long address, final long value); @Override void putByteVolatile(final long address, final byte value); @Override void putShortVolatile(final long address, final short value); @Override void putIntVolatile(final long address, final int value); @Override void putLongVolatile(final long address, final long value); @Override void get(final long src, int bytes, final @NotNull byte[] dest, final int offset); @Override void put(final long dest, int bytes, final @NotNull byte[] src, final int offset); @Override @Contract(pure = true) long virt2phys(final long address);  }### Answer:
@Test @DisplayName("virt2phys(long)") void virt2phys() { assumeTrue(mmanager != null); for (val huge : Arrays.asList(false, true)) { for (val lock : Arrays.asList(false, true)) { val bytes = createSize(0xFFFF); val virt = mmanager.allocate(bytes, huge, lock); mmanager.putByte(virt, mmanager.getByte(virt)); val phys = mmanager.virt2phys(virt); val softly = new SoftAssertions(); softly.assertThat(phys).isNotZero(); softly.assertThat(phys & (mmanager.getPageSize() - 1)).isEqualTo(virt & (mmanager.getPageSize() - 1)); mmanager.free(virt, bytes, huge, lock); softly.assertAll(); } } }