BTree implements Closeable { public void clear() throws IOException { btreeLock.writeLock().lock(); try { nodeCache.clear(); nioFile.truncate(HEADER_LENGTH); if (rootNodeID != 0) { rootNodeID = 0; writeFileHeader(); } allocatedNodesList.clear(); } finally { btreeLock.writeLock().unlock(); } } BTree(File dataDir, String filenamePrefix, int blockSize, int valueSize);  BTree(File dataDir, String filenamePrefix, int blockSize, int valueSize, boolean forceSync);  BTree(File dataDir, String filenamePrefix, int blockSize, int valueSize, RecordComparator comparator);  BTree(File dataDir, String filenamePrefix, int blockSize, int valueSize, RecordComparator comparator,
			boolean forceSync); File getFile(); boolean delete(); @Override void close(); void sync(); byte[] get(byte[] key); RecordIterator iterateAll(); RecordIterator iterateRange(byte[] minValue, byte[] maxValue); RecordIterator iterateValues(byte[] searchKey, byte[] searchMask); RecordIterator iterateRangedValues(byte[] searchKey, byte[] searchMask, byte[] minValue, byte[] maxValue); long getValueCountEstimate(); long getValueCountEstimate(byte[] minValue, byte[] maxValue); byte[] insert(byte[] value); byte[] remove(byte[] key); void clear(); void print(PrintStream out);  }
@Test public void testNewAndClear() throws Exception { btree.clear(); }