FCMapTable extends AbstractSortedMapTable { @Override public IMapEntry getMapEntry(int index) { ensureNotClosed(); Preconditions.checkArgument(index >= 0, "index (%s) must be equal to or greater than 0", index); Preconditions.checkArgument(!isEmpty(), "Can't get map entry since the map is empty"); return new FCMapEntryImpl(index, this.indexMappedByteBuffer, this.dataChannel); } FCMapTable(String dir, int level, long createdTime, int expectedInsertions);  FCMapTable(String dir, short shard, int level, long createdTime, int expectedInsertions);  FCMapTable(String dir, String fileName); IMapEntry appendNew(byte[] key, byte[] value, long timeToLive); @Override IMapEntry appendNew(byte[] key, int keyHash, byte[] value, long timeToLive, long createdTime, boolean deleted, boolean compressed); @Override IMapEntry getMapEntry(int index);  }
@Test public void testEmtpy() throws IOException, ClassNotFoundException { long createdTime = System.nanoTime(); mapTable = new FCMapTable(testDir, 1, createdTime, 1000); assertTrue(mapTable.getLevel() == 1); assertTrue(mapTable.getCreatedTime() == createdTime); assertTrue(mapTable.getAppendedSize() == 0); assertTrue(mapTable.isEmpty()); assertTrue(mapTable.getBackFileSize() == HashMapTable.INIT_INDEX_FILE_SIZE + HashMapTable.INIT_DATA_FILE_SIZE + HashMapTable.INDEX_ITEM_LENGTH); assertFalse(mapTable.isUsable()); try { @SuppressWarnings("unused") GetResult result = mapTable.get("empty".getBytes()); fail(); } catch (IllegalArgumentException iae) { } try { mapTable.getMapEntry(-1); fail(); } catch (IllegalArgumentException iae) { } try { mapTable.getMapEntry(0); } catch (IllegalArgumentException iae) { } }