### Question:
DirectLongList implements Mutable, Closeable { public void add(long x) { ensureCapacity(); Unsafe.getUnsafe().putLong(pos, x); pos += 8; } DirectLongList(long capacity); void add(long x); final void add(DirectLongList that); int binarySearch(long v); void clear(); void clear(long b); @Override void close(); long get(long p); int scanSearch(long v); void set(long p, long v); void setCapacity(long capacity); void setPos(long p); int size(); DirectLongList subset(int lo, int hi); @Override String toString(); void zero(long v);  }### Answer:
@Test public void testResizeMemLeak() { LOG.info().$("testResizeMemLeak").$(); long expected = Unsafe.getMemUsed(); try (DirectLongList list = new DirectLongList(1024)) { for (int i = 0; i < 1_000_000; i++) { list.add(i); } } Assert.assertEquals(expected, Unsafe.getMemUsed()); }