### Question:
InMemoryBTree extends AbstractBTree<K, V> implements Closeable { public void close() throws IOException { if ( getType() == BTreeTypeEnum.BACKED_ON_DISK ) { flush(); journalChannel.close(); } } InMemoryBTree();   InMemoryBTree( InMemoryBTreeConfiguration<K, V> configuration ); void close(); void flush( File file ); void load( File file ); Page<K, V> getRootPage( long revision ); Page<K, V> getRootPage(); void flush(); File getFile(); void setFilePath( String filePath ); File getJournal(); boolean isInMemory(); boolean isPersistent(); String toString(); static final String DEFAULT_JOURNAL; static final String DATA_SUFFIX; static final String JOURNAL_SUFFIX; }### Answer:
@Test public void testBrowseEmptyTree() throws Exception { BTree<Integer, String> btree = BTreeFactory.createInMemoryBTree( "test", IntSerializer.INSTANCE, StringSerializer.INSTANCE ); btree.setPageSize( 8 ); TupleCursor<Integer, String> cursor = btree.browse(); assertFalse( cursor.hasNext() ); assertFalse( cursor.hasPrev() ); cursor.close(); btree.close(); }
@Test public void testExist() throws IOException, KeyNotFoundException { BTree<Integer, String> btree = createTwoLevelBTreeFullLeaves(); for ( int i = 1; i < 21; i++ ) { assertTrue( btree.hasKey( 5 ) ); } assertFalse( btree.hasKey( 0 ) ); assertFalse( btree.hasKey( 21 ) ); btree.close(); }