Queues { static <E> Queue<E> getQueue(Engine engine, Serializer<Serializer> serializerSerializer, long rootRecid){ QueueRoot root = engine.get(rootRecid, new QueueRootSerializer(serializerSerializer)); return new Queue<E>(engine, root.serializer, root.headerRecid, root.nextTailRecid,root.sizeRecid); } private  Queues();   }
@Test public void queue_persisted(){ File f = Utils.tempDbFile(); DB db = DBMaker.newFileDB(f).journalDisable().cacheDisable().asyncWriteDisable().make(); Queue<Object> queue = db.getQueue("test"); queue.add("1"); queue.add("2"); queue.add("3"); queue.add("4"); db.close(); db = DBMaker.newFileDB(f).journalDisable().cacheDisable().asyncWriteDisable().deleteFilesAfterClose().make(); queue = db.getQueue("test"); assertEquals("1", queue.poll()); assertEquals("2", queue.poll()); assertEquals("3", queue.poll()); assertEquals("4", queue.poll()); assertNull(queue.poll()); db.close(); }