BLink implements AutoCloseable, Page.Owner { @Override public void unload(long pageId) { nodes.get(pageId).unload(true, false); } BLink(
            long maxSize, SizeEvaluator<K, V> evaluator,
            PageReplacementPolicy policy, BLinkIndexDataStorage<K, V> storage
    );  BLink(
            long maxSize, SizeEvaluator<K, V> evaluator,
            PageReplacementPolicy policy, BLinkIndexDataStorage<K, V> storage,
            BLinkMetadata<K> metadata
    ); @Override void close(); void truncate(); long size(); long getUsedMemory(); int nodes(); @Override void unload(long pageId); BLinkMetadata<K> checkpoint(); V search(K v); Stream<Entry<K, V>> scan(K from, K to); Stream<Entry<K, V>> scan(K from, K to, boolean toInclusive); boolean insert(K v, V e, V expected); V insert(K v, V e); V delete(K v); @Override String toString(); @SuppressWarnings("unchecked") String toStringFull();  }
@Test public void testUnload() throws Exception { final int pages = 5; final int inserts = 100; BLinkIndexDataStorage<Sized<Long>, Long> storage = new DummyBLinkIndexDataStorage<>(); PageReplacementPolicy policy = new RandomPageReplacementPolicy(pages); try (BLink<Sized<Long>, Long> blink = new BLink<>(2048L, new LongSizeEvaluator(), policy, storage)) { for (long l = 0; l < inserts; l++) { blink.insert(Sized.valueOf(l), l); } assertEquals(pages, policy.size()); assertEquals(inserts, blink.size()); blink.close(); assertEquals(0, policy.size()); assertEquals(0, blink.size()); } }