MapDBMapFactory extends MapFactory implements Closeable { @Override public BTreeMap<Path, Revision> create() { return db.createTreeMap(String.valueOf(counter.incrementAndGet())) .keySerializer(new PathSerializer()) .valueSerializer(new RevisionSerializer()) .counterEnable() .make(); } MapDBMapFactory(); @Override BTreeMap<Path, Revision> create(); @Override void close();  }
@Test public void mapDB() throws IOException { try (MapDBMapFactory dbf = new MapDBMapFactory()) { ConcurrentMap<Path, Revision> map = dbf.create(); for (int i = 0; i < 10000; i++) { map.put(Path.fromString("/some/test/path/node-" + i), new Revision(i, 0, 1)); } for (int i = 0; i < 10000; i++) { assertEquals(new Revision(i, 0, 1), map.get(Path.fromString("/some/test/path/node-" + i))); } } }