Index: applications/editors/josm/plugins/imagerycache/src/org/mapdb/AsyncWriteEngine.java
===================================================================
--- applications/editors/josm/plugins/imagerycache/src/org/mapdb/AsyncWriteEngine.java	(revision 30532)
+++ applications/editors/josm/plugins/imagerycache/src/org/mapdb/AsyncWriteEngine.java	(revision 30737)
@@ -36,5 +36,5 @@
     protected final long threadNum = threadCounter.incrementAndGet();
 
-    protected final BlockingQueue<Long> newRecids = new ArrayBlockingQueue<Long>(128);
+    protected final BlockingQueue<Long> newRecids = new ArrayBlockingQueue<>(128);
 
     protected volatile boolean closeInProgress = false;
@@ -266,5 +266,5 @@
      */
     public void setParentEngineReference(Engine parentEngineReference) {
-        parentEngineWeakRef = new WeakReference<Engine>(parentEngineReference);
+        parentEngineWeakRef = new WeakReference<>(parentEngineReference);
     }
 
Index: applications/editors/josm/plugins/imagerycache/src/org/mapdb/Atomic.java
===================================================================
--- applications/editors/josm/plugins/imagerycache/src/org/mapdb/Atomic.java	(revision 30532)
+++ applications/editors/josm/plugins/imagerycache/src/org/mapdb/Atomic.java	(revision 30737)
@@ -213,5 +213,5 @@
         long recid = db.getEngine().put(initVal, serializer);
         db.getNameDir().put(name, recid);
-        return new Var<E>(db.getEngine(), recid, serializer);
+        return new Var<>(db.getEngine(), recid, serializer);
     }
 
@@ -230,5 +230,5 @@
         return  recid == null ?
                 createVar(db, name, null, serializer) :
-                new Var<E>(db.getEngine(),recid, serializer);
+                new Var<>(db.getEngine(),recid, serializer);
     }
 
Index: applications/editors/josm/plugins/imagerycache/src/org/mapdb/BTreeMap.java
===================================================================
--- applications/editors/josm/plugins/imagerycache/src/org/mapdb/BTreeMap.java	(revision 30532)
+++ applications/editors/josm/plugins/imagerycache/src/org/mapdb/BTreeMap.java	(revision 30737)
@@ -114,5 +114,5 @@
 
     /** holds node level locks*/
-    protected final LongConcurrentHashMap<Thread> nodeLocks = new LongConcurrentHashMap<Thread>();
+    protected final LongConcurrentHashMap<Thread> nodeLocks = new LongConcurrentHashMap<>();
 
     /** maximal node size allowed in this BTree*/
@@ -963,5 +963,5 @@
     protected Entry<K, V> makeEntry(Object key, Object value) {
         if(value instanceof ValRef) throw new InternalError();
-        return new SimpleImmutableEntry<K, V>((K)key,  (V)value);
+        return new SimpleImmutableEntry<>((K)key,  (V)value);
     }
 
@@ -1336,5 +1336,5 @@
         if (fromKey == null || toKey == null)
             throw new NullPointerException();
-        return new SubMap<K,V>
+        return new SubMap<>
                 ( this, fromKey, fromInclusive, toKey, toInclusive);
     }
@@ -1345,5 +1345,5 @@
         if (toKey == null)
             throw new NullPointerException();
-        return new SubMap<K,V>
+        return new SubMap<>
                 (this, null, false, toKey, inclusive);
     }
@@ -1354,5 +1354,5 @@
         if (fromKey == null)
             throw new NullPointerException();
-        return new SubMap<K,V>
+        return new SubMap<>
                 (this, fromKey, inclusive, null, false);
     }
@@ -1421,5 +1421,5 @@
     static final <E> List<E> toList(Collection<E> c) {
         // Using size() here would be a pessimization.
-        List<E> list = new ArrayList<E>();
+        List<E> list = new ArrayList<>();
         for (E e : c){
             list.add(e);
@@ -1506,14 +1506,14 @@
                                       E toElement,
                                       boolean toInclusive) {
-            return new KeySet<E>(m.subMap(fromElement, fromInclusive,
+            return new KeySet<>(m.subMap(fromElement, fromInclusive,
                     toElement,   toInclusive),hasValues);
         }
         @Override
 		public NavigableSet<E> headSet(E toElement, boolean inclusive) {
-            return new KeySet<E>(m.headMap(toElement, inclusive),hasValues);
+            return new KeySet<>(m.headMap(toElement, inclusive),hasValues);
         }
         @Override
 		public NavigableSet<E> tailSet(E fromElement, boolean inclusive) {
-            return new KeySet<E>(m.tailMap(fromElement, inclusive),hasValues);
+            return new KeySet<>(m.tailMap(fromElement, inclusive),hasValues);
         }
         @Override
@@ -1937,5 +1937,5 @@
                 }
             }
-            return new SubMap<K,V>(m, fromKey, fromInclusive,
+            return new SubMap<>(m, fromKey, fromInclusive,
                     toKey, toInclusive);
         }
@@ -1989,5 +1989,5 @@
         @Override
         public NavigableSet<K> navigableKeySet() {
-            return new KeySet<K>((ConcurrentNavigableMap<K,Object>) this,m.hasValues);
+            return new KeySet<>((ConcurrentNavigableMap<K,Object>) this,m.hasValues);
         }
 
@@ -2032,5 +2032,5 @@
         @Override
         public NavigableSet<K> keySet() {
-            return new KeySet<K>((ConcurrentNavigableMap<K,Object>) this, m.hasValues);
+            return new KeySet<>((ConcurrentNavigableMap<K,Object>) this, m.hasValues);
         }
 
@@ -2044,5 +2044,5 @@
         @Override
         public Set<Entry<K, V>> entrySet() {
-            return new EntrySet<K, V>(this);
+            return new EntrySet<>(this);
         }
 
@@ -2123,5 +2123,5 @@
         Engine snapshot = SnapshotEngine.createSnapshotFor(engine);
 
-        return new BTreeMap<K, V>(snapshot,treeRecid, defaultSerializer);
+        return new BTreeMap<>(snapshot,treeRecid, defaultSerializer);
     }
 
Index: applications/editors/josm/plugins/imagerycache/src/org/mapdb/CacheHardRef.java
===================================================================
--- applications/editors/josm/plugins/imagerycache/src/org/mapdb/CacheHardRef.java	(revision 30532)
+++ applications/editors/josm/plugins/imagerycache/src/org/mapdb/CacheHardRef.java	(revision 30737)
@@ -31,5 +31,5 @@
 
     public CacheHardRef(Engine engine, int initialCapacity) {
-        super(engine, new LongConcurrentHashMap<Object>(initialCapacity));
+        super(engine, new LongConcurrentHashMap<>(initialCapacity));
     }
 
Index: applications/editors/josm/plugins/imagerycache/src/org/mapdb/CacheLRU.java
===================================================================
--- applications/editors/josm/plugins/imagerycache/src/org/mapdb/CacheLRU.java	(revision 30532)
+++ applications/editors/josm/plugins/imagerycache/src/org/mapdb/CacheLRU.java	(revision 30737)
@@ -16,5 +16,5 @@
 
     public CacheLRU(Engine engine, int cacheSize) {
-        this(engine, new LongConcurrentLRUMap<Object>(cacheSize, (int) (cacheSize*0.8)));
+        this(engine, new LongConcurrentLRUMap<>(cacheSize, (int) (cacheSize*0.8)));
     }
 
Index: applications/editors/josm/plugins/imagerycache/src/org/mapdb/CacheWeakSoftRef.java
===================================================================
--- applications/editors/josm/plugins/imagerycache/src/org/mapdb/CacheWeakSoftRef.java	(revision 30532)
+++ applications/editors/josm/plugins/imagerycache/src/org/mapdb/CacheWeakSoftRef.java	(revision 30737)
@@ -79,5 +79,5 @@
 
 
-    protected LongConcurrentHashMap<CacheItem> items = new LongConcurrentHashMap<CacheItem>();
+    protected LongConcurrentHashMap<CacheItem> items = new LongConcurrentHashMap<>();
 
 
@@ -157,6 +157,6 @@
         ReferenceQueue<A> q = checkClosed(queue);
         checkClosed(items).put(recid, useWeakRef?
-            new CacheWeakItem<A>(value, q, recid) :
-            new CacheSoftItem<A>(value, q, recid));
+            new CacheWeakItem<>(value, q, recid) :
+            new CacheSoftItem<>(value, q, recid));
     }
 
Index: applications/editors/josm/plugins/imagerycache/src/org/mapdb/CompressLZF.java
===================================================================
--- applications/editors/josm/plugins/imagerycache/src/org/mapdb/CompressLZF.java	(revision 30532)
+++ applications/editors/josm/plugins/imagerycache/src/org/mapdb/CompressLZF.java	(revision 30737)
@@ -346,5 +346,5 @@
      */
     public static <E> Serializer<E> CompressionWrapper(Serializer<E> serializer) {
-        return new Serializer.CompressSerializerWrapper<E>(serializer);
+        return new Serializer.CompressSerializerWrapper<>(serializer);
     }
 
Index: applications/editors/josm/plugins/imagerycache/src/org/mapdb/DB.java
===================================================================
--- applications/editors/josm/plugins/imagerycache/src/org/mapdb/DB.java	(revision 30532)
+++ applications/editors/josm/plugins/imagerycache/src/org/mapdb/DB.java	(revision 30737)
@@ -32,5 +32,5 @@
     protected Engine engine;
     /** already loaded named collections. It is important to keep collections as singletons, because of 'in-memory' locking*/
-    protected Map<String, WeakReference<?>> collections = new HashMap<String, WeakReference<?>>();
+    protected Map<String, WeakReference<?>> collections = new HashMap<>();
 
     /** view over named records */
@@ -79,9 +79,9 @@
         if(recid!=null){
             //open existing map
-            ret = new HTreeMap<K,V>(engine, recid,defaultSerializer);
+            ret = new HTreeMap<>(engine, recid,defaultSerializer);
             if(!ret.hasValues) throw new ClassCastException("Collection is Set, not Map");
         }else{
             //create new map
-            ret = new HTreeMap<K,V>(engine,true,false,Utils.RANDOM.nextInt(), defaultSerializer,null, null);
+            ret = new HTreeMap<>(engine,true,false,Utils.RANDOM.nextInt(), defaultSerializer,null, null);
             nameDir.put(name, ret.rootRecid);
         }
@@ -106,5 +106,5 @@
             String name, boolean keepCounter, Serializer<K> keySerializer, Serializer<V> valueSerializer){
         checkNameNotExists(name);
-        HTreeMap<K,V> ret = new HTreeMap<K,V>(engine, true,keepCounter,Utils.RANDOM.nextInt(), defaultSerializer, keySerializer, valueSerializer);
+        HTreeMap<K,V> ret = new HTreeMap<>(engine, true,keepCounter,Utils.RANDOM.nextInt(), defaultSerializer, keySerializer, valueSerializer);
         nameDir.put(name, ret.rootRecid);
         collections.put(name, new WeakReference<Object>(ret));
@@ -126,10 +126,10 @@
         if(recid!=null){
             //open existing map
-            HTreeMap<K,Object> m = new HTreeMap<K,Object>(engine, recid, defaultSerializer);
+            HTreeMap<K,Object> m = new HTreeMap<>(engine, recid, defaultSerializer);
             if(m.hasValues) throw new ClassCastException("Collection is Map, not Set");
             ret = m.keySet();
         }else{
             //create new map
-            HTreeMap<K,Object> m = new HTreeMap<K,Object>(engine, false,false, Utils.RANDOM.nextInt(), defaultSerializer, null, null);
+            HTreeMap<K,Object> m = new HTreeMap<>(engine, false,false, Utils.RANDOM.nextInt(), defaultSerializer, null, null);
             ret = m.keySet();
             nameDir.put(name, m.rootRecid);
@@ -151,5 +151,5 @@
     synchronized public <K> Set<K> createHashSet(String name, boolean keepCounter, Serializer<K> serializer){
         checkNameNotExists(name);
-        HTreeMap<K,Object> ret = new HTreeMap<K,Object>(engine, false,keepCounter,Utils.RANDOM.nextInt(), defaultSerializer, serializer, null);
+        HTreeMap<K,Object> ret = new HTreeMap<>(engine, false,keepCounter,Utils.RANDOM.nextInt(), defaultSerializer, serializer, null);
         nameDir.put(name, ret.rootRecid);
         Set<K> ret2 = ret.keySet();
@@ -177,9 +177,9 @@
         if(recid!=null){
             //open existing map
-            ret = new BTreeMap<K,V>(engine, recid,defaultSerializer);
+            ret = new BTreeMap<>(engine, recid,defaultSerializer);
             if(!ret.hasValues) throw new ClassCastException("Collection is Set, not Map");
         }else{
             //create new map
-            ret = new BTreeMap<K,V>(engine,BTreeMap.DEFAULT_MAX_NODE_SIZE, true, false,false, defaultSerializer, null, null, null);
+            ret = new BTreeMap<>(engine,BTreeMap.DEFAULT_MAX_NODE_SIZE, true, false,false, defaultSerializer, null, null, null);
             nameDir.put(name, ret.treeRecid);
         }
@@ -206,5 +206,5 @@
             BTreeKeySerializer<K> keySerializer, Serializer<V> valueSerializer, Comparator<K> comparator){
         checkNameNotExists(name);
-        BTreeMap<K,V> ret = new BTreeMap<K,V>(engine, nodeSize, true,valuesStoredOutsideNodes, keepCounter,defaultSerializer, keySerializer, valueSerializer, comparator);
+        BTreeMap<K,V> ret = new BTreeMap<>(engine, nodeSize, true,valuesStoredOutsideNodes, keepCounter,defaultSerializer, keySerializer, valueSerializer, comparator);
         nameDir.put(name, ret.treeRecid);
         collections.put(name, new WeakReference<Object>(ret));
@@ -236,10 +236,10 @@
         if(recid!=null){
             //open existing map
-            BTreeMap<K,Object> m = new BTreeMap<K,Object>(engine,  recid, defaultSerializer);
+            BTreeMap<K,Object> m = new BTreeMap<>(engine,  recid, defaultSerializer);
             if(m.hasValues) throw new ClassCastException("Collection is Map, not Set");
             ret = m.keySet();
         }else{
             //create new map
-            BTreeMap<K,Object> m =  new BTreeMap<K,Object>(engine,BTreeMap.DEFAULT_MAX_NODE_SIZE,
+            BTreeMap<K,Object> m =  new BTreeMap<>(engine,BTreeMap.DEFAULT_MAX_NODE_SIZE,
                     false, false,false, defaultSerializer, null, null, null);
             nameDir.put(name, m.treeRecid);
@@ -264,5 +264,5 @@
     synchronized public <K> NavigableSet<K> createTreeSet(String name,int nodeSize, boolean keepCounter, BTreeKeySerializer<K> serializer, Comparator<K> comparator){
         checkNameNotExists(name);
-        BTreeMap<K,Object> ret = new BTreeMap<K,Object>(engine, nodeSize, false, false, keepCounter, defaultSerializer, serializer, null, comparator);
+        BTreeMap<K,Object> ret = new BTreeMap<>(engine, nodeSize, false, false, keepCounter, defaultSerializer, serializer, null, comparator);
         nameDir.put(name, ret.treeRecid);
         NavigableSet<K> ret2 = ret.keySet();
Index: applications/editors/josm/plugins/imagerycache/src/org/mapdb/EngineWrapper.java
===================================================================
--- applications/editors/josm/plugins/imagerycache/src/org/mapdb/EngineWrapper.java	(revision 30532)
+++ applications/editors/josm/plugins/imagerycache/src/org/mapdb/EngineWrapper.java	(revision 30737)
@@ -228,5 +228,5 @@
         //TODO CAS
 
-        final Queue<Record> records = new ConcurrentLinkedQueue<Record>();
+        final Queue<Record> records = new ConcurrentLinkedQueue<>();
 
 
@@ -337,5 +337,5 @@
             if(item!=null) item.check();
             A ret = super.get(recid, serializer);
-            if(ret!=null) items.put(recid, new Item<A>(serializer,ret));
+            if(ret!=null) items.put(recid, new Item<>(serializer,ret));
             return ret;
         }
@@ -344,5 +344,5 @@
         public <A> long put(A value, Serializer<A> serializer) {
             long ret =  super.put(value, serializer);
-            if(value!=null) items.put(ret, new Item<A>(serializer,value));
+            if(value!=null) items.put(ret, new Item<>(serializer,value));
             return ret;
         }
@@ -353,5 +353,5 @@
             if(item!=null) item.check();
             super.update(recid, value, serializer);
-            if(value!=null) items.put(recid, new Item<A>(serializer,value));
+            if(value!=null) items.put(recid, new Item<>(serializer,value));
         }
 
Index: applications/editors/josm/plugins/imagerycache/src/org/mapdb/Fun.java
===================================================================
--- applications/editors/josm/plugins/imagerycache/src/org/mapdb/Fun.java	(revision 30532)
+++ applications/editors/josm/plugins/imagerycache/src/org/mapdb/Fun.java	(revision 30737)
@@ -43,13 +43,13 @@
 
     public static <A,B> Tuple2<A,B> t2(A a, B b) {
-        return new Tuple2<A, B>(a,b);
+        return new Tuple2<>(a,b);
     }
 
     public static <A,B,C> Tuple3<A,B,C> t3(A a, B b, C c) {
-        return new Tuple3<A, B, C>((A)a, (B)b, (C)c);
+        return new Tuple3<>((A)a, (B)b, (C)c);
     }
 
     public static <A,B,C,D> Tuple4<A,B,C,D> t4(A a, B b, C c, D d) {
-        return new Tuple4<A, B, C, D>(a,b,c,d);
+        return new Tuple4<>(a,b,c,d);
     }
 
Index: applications/editors/josm/plugins/imagerycache/src/org/mapdb/HTreeMap.java
===================================================================
--- applications/editors/josm/plugins/imagerycache/src/org/mapdb/HTreeMap.java	(revision 30532)
+++ applications/editors/josm/plugins/imagerycache/src/org/mapdb/HTreeMap.java	(revision 30737)
@@ -137,5 +137,5 @@
         @Override
         public LinkedNode<K,V> deserialize(DataInput in, int available) throws IOException {
-            return new LinkedNode<K, V>(
+            return new LinkedNode<>(
                     Utils.unpackLong(in),
                     (K) keySerializer.deserialize(in,-1),
@@ -294,5 +294,5 @@
         HashRoot r = engine.get(Engine.NAME_DIR_RECID, serializer);
         if(r!=null)
-            return new HTreeMap<String, Long>(engine, Engine.NAME_DIR_RECID, Serializer.BASIC_SERIALIZER);
+            return new HTreeMap<>(engine, Engine.NAME_DIR_RECID, Serializer.BASIC_SERIALIZER);
 
         if(engine.isReadOnly())
@@ -310,5 +310,5 @@
         engine.update(Engine.NAME_DIR_RECID, r, serializer);
         //and now load it
-        return new HTreeMap<String, Long>(engine, Engine.NAME_DIR_RECID, Serializer.BASIC_SERIALIZER);
+        return new HTreeMap<>(engine, Engine.NAME_DIR_RECID, Serializer.BASIC_SERIALIZER);
 
     }
@@ -482,5 +482,5 @@
                             //found, replace value at this node
                             V oldVal = ln.value;
-                            ln = new LinkedNode<K, V>(ln.next, ln.key, value);
+                            ln = new LinkedNode<>(ln.next, ln.key, value);
                             engine.update(recid, ln, LN_SERIALIZER);
                             notify(key,  oldVal, value);
@@ -503,5 +503,5 @@
                         int pos =(h >>>(7*(level-1) )) & 0x7F;
                         nextDir[pos/8] = new long[8];
-                        nextDir[pos/8][pos%8] = (engine.put(new LinkedNode<K, V>(0, key, value), LN_SERIALIZER) <<1) | 1;
+                        nextDir[pos/8][pos%8] = (engine.put(new LinkedNode<>(0, key, value), LN_SERIALIZER) <<1) | 1;
                     }
 
@@ -514,5 +514,5 @@
                         int pos = (hash(n.key) >>>(7*(level -1) )) & 0x7F;
                         if(nextDir[pos/8]==null) nextDir[pos/8] = new long[8];
-                        n = new LinkedNode<K, V>(nextDir[pos/8][pos%8]>>>1, n.key, n.value);
+                        n = new LinkedNode<>(nextDir[pos/8][pos%8]>>>1, n.key, n.value);
                         nextDir[pos/8][pos%8] = (nodeRecid<<1) | 1;
                         engine.update(nodeRecid, n, LN_SERIALIZER);
@@ -530,5 +530,5 @@
                     // record does not exist in linked list, so create new one
                     recid = dir[slot/8][slot%8]>>>1;
-                    long newRecid = engine.put(new LinkedNode<K, V>(recid, key, value), LN_SERIALIZER);
+                    long newRecid = engine.put(new LinkedNode<>(recid, key, value), LN_SERIALIZER);
                     dir[slot/8][slot%8] = (newRecid<<1) | 1;
                     engine.update(dirRecid, dir, DIR_SERIALIZER);
@@ -601,5 +601,5 @@
                             }else{
                                 //referenced from LinkedNode
-                                prevLn = new LinkedNode<K, V>(ln.next, prevLn.key, prevLn.value);
+                                prevLn = new LinkedNode<>(ln.next, prevLn.key, prevLn.value);
                                 engine.update(prevRecid, prevLn, LN_SERIALIZER);
                             }
@@ -1176,5 +1176,5 @@
     public Map<K,V> snapshot(){
         Engine snapshot = SnapshotEngine.createSnapshotFor(engine);
-        return new HTreeMap<K, V>(snapshot,rootRecid, defaultSerialzierForSnapshots);
+        return new HTreeMap<>(snapshot,rootRecid, defaultSerialzierForSnapshots);
     }
 
Index: applications/editors/josm/plugins/imagerycache/src/org/mapdb/LongConcurrentHashMap.java
===================================================================
--- applications/editors/josm/plugins/imagerycache/src/org/mapdb/LongConcurrentHashMap.java	(revision 30532)
+++ applications/editors/josm/plugins/imagerycache/src/org/mapdb/LongConcurrentHashMap.java	(revision 30737)
@@ -386,5 +386,5 @@
                     oldValue = null;
                     ++modCount;
-                    tab[index] = new HashEntry<V>(key, hash, first, value);
+                    tab[index] = new HashEntry<>(key, hash, first, value);
                     count = c; // write-volatile
                 }
@@ -448,5 +448,5 @@
                             int k = p.hash & sizeMask;
                             HashEntry<V> n = newTable[k];
-                            newTable[k] = new HashEntry<V>(p.key, p.hash,
+                            newTable[k] = new HashEntry<>(p.key, p.hash,
                                     n, p.value);
                         }
@@ -482,5 +482,5 @@
                         HashEntry<V> newFirst = e.next;
                         for (HashEntry<V> p = first; p != e; p = p.next)
-                            newFirst = new HashEntry<V>(p.key, p.hash,
+                            newFirst = new HashEntry<>(p.key, p.hash,
                                                           newFirst, p.value);
                         tab[index] = newFirst;
@@ -559,5 +559,5 @@
 
         for (int i = 0; i < this.segments.length; ++i)
-            this.segments[i] = new Segment<V>(cap, loadFactor);
+            this.segments[i] = new Segment<>(cap, loadFactor);
     }
 
Index: applications/editors/josm/plugins/imagerycache/src/org/mapdb/LongHashMap.java
===================================================================
--- applications/editors/josm/plugins/imagerycache/src/org/mapdb/LongHashMap.java	(revision 30532)
+++ applications/editors/josm/plugins/imagerycache/src/org/mapdb/LongHashMap.java	(revision 30737)
@@ -379,5 +379,5 @@
 
     Entry<V> createHashedEntry(long key, int index, int hash) {
-        Entry<V> entry = new Entry<V>(key,hash);
+        Entry<V> entry = new Entry<>(key,hash);
         entry.next = elementData[index];
         elementData[index] = entry;
@@ -466,10 +466,10 @@
     @Override
     public Iterator<V> valuesIterator() {
-        return new ValueIterator<V>(this);
+        return new ValueIterator<>(this);
     }
 
     @Override
     public LongMapIterator<V> longMapIterator() {
-        return new EntryIterator<V>(this);
+        return new EntryIterator<>(this);
     }
 
Index: applications/editors/josm/plugins/imagerycache/src/org/mapdb/Queues.java
===================================================================
--- applications/editors/josm/plugins/imagerycache/src/org/mapdb/Queues.java	(revision 30532)
+++ applications/editors/josm/plugins/imagerycache/src/org/mapdb/Queues.java	(revision 30737)
@@ -44,5 +44,5 @@
             public Node<E> deserialize(DataInput in, int available) throws IOException {
                 if(available==0)return Node.EMPTY;
-                return new Node<E>(Utils.unpackLong(in), serializer.deserialize(in,-1));
+                return new Node<>(Utils.unpackLong(in), serializer.deserialize(in,-1));
             }
         }
@@ -56,5 +56,5 @@
             if(headRecid == 0) headRecid = engine.put(0L, Serializer.LONG_SERIALIZER);
             head = new Atomic.Long(engine,headRecid);
-            nodeSerializer = new NodeSerializer<E>(serializer);
+            nodeSerializer = new NodeSerializer<>(serializer);
         }
 
@@ -246,10 +246,10 @@
         public boolean add(E e) {
             long head2 = head.get();
-            Node<E> n = new Node<E>(head2, e);
+            Node<E> n = new Node<>(head2, e);
             long recid = engine.put(n, nodeSerializer);
             while(!head.compareAndSet(head2, recid)){
                 //failed to update head, so read new value and start over
                 head2 = head.get();
-                n = new Node<E>(head2, e);
+                n = new Node<>(head2, e);
                 engine.update(recid, n, nodeSerializer);
             }
@@ -307,5 +307,5 @@
     static <E> Stack<E> getStack(Engine engine, Serializer<Serializer> serializerSerializer, long rootRecid){
         StackRoot root = engine.get(rootRecid, new StackRootSerializer(serializerSerializer));
-        return new Stack<E>(engine, root.serializer, root.headerRecid, root.useLocks);
+        return new Stack<>(engine, root.serializer, root.headerRecid, root.useLocks);
     }
 
@@ -330,5 +330,5 @@
         public boolean add(E item){
             final long nextTail = engine.put((Node<E>)Node.EMPTY, nodeSerializer);
-            Node<E> n = new Node<E>(nextTail, item);
+            Node<E> n = new Node<>(nextTail, item);
             long tail2 = tail.get();
             while(!engine.compareAndSwap(tail2, (Node<E>)Node.EMPTY, n, nodeSerializer)){
@@ -435,5 +435,5 @@
     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);
+        return new Queue<>(engine, root.serializer, root.headerRecid, root.nextTailRecid,root.sizeRecid);
     }
 
@@ -459,5 +459,5 @@
                 long nRecid = headInsert.get();
                 Node<E> n = engine.get(nRecid, nodeSerializer);
-                n = new Node<E>(n.next, (E) o);
+                n = new Node<>(n.next, (E) o);
                 engine.update(nRecid, n, nodeSerializer);
                 headInsert.set(n.next);
@@ -579,5 +579,5 @@
     static <E> CircularQueue<E> getCircularQueue(Engine engine, Serializer<Serializer> serializerSerializer, long rootRecid){
         CircularQueueRoot root = engine.get(rootRecid, new CircularQueueRootSerializer(serializerSerializer));
-        return new CircularQueue<E>(engine, root.serializer, root.headerRecid, root.headerInsertRecid,root.sizeRecid);
+        return new CircularQueue<>(engine, root.serializer, root.headerRecid, root.headerInsertRecid,root.sizeRecid);
     }
 
Index: applications/editors/josm/plugins/imagerycache/src/org/mapdb/SerializerBase.java
===================================================================
--- applications/editors/josm/plugins/imagerycache/src/org/mapdb/SerializerBase.java	(revision 30532)
+++ applications/editors/josm/plugins/imagerycache/src/org/mapdb/SerializerBase.java	(revision 30737)
@@ -1301,5 +1301,5 @@
     private ArrayList<Object> deserializeArrayList(DataInput is, FastArrayList<Object> objectStack) throws IOException {
         int size = Utils.unpackInt(is);
-        ArrayList<Object> s = new ArrayList<Object>(size);
+        ArrayList<Object> s = new ArrayList<>(size);
         objectStack.add(s);
         for (int i = 0; i < size; i++) {
@@ -1314,5 +1314,5 @@
             throw new EOFException();
 
-        ArrayList<Object> s = new ArrayList<Object>(size);
+        ArrayList<Object> s = new ArrayList<>(size);
         for (int i = 0; i < size; i++) {
             long l = Utils.unpackLong(is);
@@ -1338,5 +1338,5 @@
     private Vector<Object> deserializeVector(DataInput is, FastArrayList<Object> objectStack) throws IOException {
         int size = Utils.unpackInt(is);
-        Vector<Object> s = new Vector<Object>(size);
+        Vector<Object> s = new Vector<>(size);
         objectStack.add(s);
         for (int i = 0; i < size; i++)
@@ -1348,5 +1348,5 @@
     private HashSet<Object> deserializeHashSet(DataInput is, FastArrayList<Object> objectStack) throws IOException {
         int size = Utils.unpackInt(is);
-        HashSet<Object> s = new HashSet<Object>(size);
+        HashSet<Object> s = new HashSet<>(size);
         objectStack.add(s);
         for (int i = 0; i < size; i++)
@@ -1358,5 +1358,5 @@
     private LinkedHashSet<Object> deserializeLinkedHashSet(DataInput is, FastArrayList<Object> objectStack) throws IOException {
         int size = Utils.unpackInt(is);
-        LinkedHashSet<Object> s = new LinkedHashSet<Object>(size);
+        LinkedHashSet<Object> s = new LinkedHashSet<>(size);
         objectStack.add(s);
         for (int i = 0; i < size; i++)
@@ -1368,9 +1368,9 @@
     private TreeSet<Object> deserializeTreeSet(DataInput is, FastArrayList<Object> objectStack) throws IOException {
         int size = Utils.unpackInt(is);
-        TreeSet<Object> s = new TreeSet<Object>();
+        TreeSet<Object> s = new TreeSet<>();
         objectStack.add(s);
         Comparator comparator = (Comparator) deserialize(is, objectStack);
         if (comparator != null)
-            s = new TreeSet<Object>(comparator);
+            s = new TreeSet<>(comparator);
 
         for (int i = 0; i < size; i++)
@@ -1383,9 +1383,9 @@
         int size = Utils.unpackInt(is);
 
-        TreeMap<Object, Object> s = new TreeMap<Object, Object>();
+        TreeMap<Object, Object> s = new TreeMap<>();
         objectStack.add(s);
         Comparator comparator = (Comparator) deserialize(is, objectStack);
         if (comparator != null)
-            s = new TreeMap<Object, Object>(comparator);
+            s = new TreeMap<>(comparator);
         for (int i = 0; i < size; i++)
             s.put(deserialize(is, objectStack), deserialize(is, objectStack));
@@ -1397,5 +1397,5 @@
         int size = Utils.unpackInt(is);
 
-        HashMap<Object, Object> s = new HashMap<Object, Object>(size);
+        HashMap<Object, Object> s = new HashMap<>(size);
         objectStack.add(s);
         for (int i = 0; i < size; i++)
@@ -1407,5 +1407,5 @@
         int size = Utils.unpackInt(is);
 
-        IdentityHashMap<Object, Object> s = new IdentityHashMap<Object, Object>(size);
+        IdentityHashMap<Object, Object> s = new IdentityHashMap<>(size);
         objectStack.add(s);
         for (int i = 0; i < size; i++)
@@ -1417,5 +1417,5 @@
         int size = Utils.unpackInt(is);
 
-        LinkedHashMap<Object, Object> s = new LinkedHashMap<Object, Object>(size);
+        LinkedHashMap<Object, Object> s = new LinkedHashMap<>(size);
         objectStack.add(s);
         for (int i = 0; i < size; i++)
@@ -1428,5 +1428,5 @@
         int size = Utils.unpackInt(is);
 
-        Hashtable<Object, Object> s = new Hashtable<Object, Object>(size);
+        Hashtable<Object, Object> s = new Hashtable<>(size);
         objectStack.add(s);
         for (int i = 0; i < size; i++)
Index: applications/editors/josm/plugins/imagerycache/src/org/mapdb/SerializerPojo.java
===================================================================
--- applications/editors/josm/plugins/imagerycache/src/org/mapdb/SerializerPojo.java	(revision 30532)
+++ applications/editors/josm/plugins/imagerycache/src/org/mapdb/SerializerPojo.java	(revision 30737)
@@ -59,8 +59,8 @@
         @Override
 		public CopyOnWriteArrayList<ClassInfo> deserialize(DataInput in, int available) throws IOException{
-            if(available==0) return new CopyOnWriteArrayList<ClassInfo>();
+            if(available==0) return new CopyOnWriteArrayList<>();
 
             int size = Utils.unpackInt(in);
-            ArrayList<ClassInfo> ret = new ArrayList<ClassInfo>(size);
+            ArrayList<ClassInfo> ret = new ArrayList<>(size);
 
             for (int i = 0; i < size; i++) {
@@ -76,5 +76,5 @@
                 ret.add(new ClassInfo(className, fields,isEnum,isExternalizable));
             }
-            return new CopyOnWriteArrayList<ClassInfo>(ret);
+            return new CopyOnWriteArrayList<>(ret);
         }
     };
@@ -95,5 +95,5 @@
     public SerializerPojo(CopyOnWriteArrayList<ClassInfo> registered){
         if(registered == null)
-            this.registered = new CopyOnWriteArrayList<ClassInfo>();
+            this.registered = new CopyOnWriteArrayList<>();
         else
             this.registered = registered;
@@ -107,7 +107,7 @@
 
         private final String name;
-        private final List<FieldInfo> fields = new ArrayList<FieldInfo>();
-        private final Map<String, FieldInfo> name2fieldInfo = new HashMap<String, FieldInfo>();
-        private final Map<String, Integer> name2fieldId = new HashMap<String, Integer>();
+        private final List<FieldInfo> fields = new ArrayList<>();
+        private final Map<String, FieldInfo> name2fieldInfo = new HashMap<>();
+        private final Map<String, Integer> name2fieldId = new HashMap<>();
         private ObjectStreamField[] objectStreamFields;
 
@@ -290,6 +290,6 @@
 
     CopyOnWriteArrayList<ClassInfo> registered;
-    Map<Class<?>, Integer> class2classId = new HashMap<Class<?>, Integer>();
-    Map<Integer, Class<?>> classId2class = new HashMap<Integer, Class<?>>();
+    Map<Class<?>, Integer> class2classId = new HashMap<>();
+    Map<Integer, Class<?>> classId2class = new HashMap<>();
 
 
@@ -333,5 +333,5 @@
         if (fields == null) {
             ObjectStreamClass streamClass = ObjectStreamClass.lookup(clazz);
-            FastArrayList<ObjectStreamField> fieldsList = new FastArrayList<ObjectStreamField>();
+            FastArrayList<ObjectStreamField> fieldsList = new FastArrayList<>();
             while (streamClass != null) {
                 for (ObjectStreamField f : streamClass.getFields()) {
@@ -567,5 +567,5 @@
 
 
-    private static Map<Class<?>, Constructor<?>> class2constuctor = new ConcurrentHashMap<Class<?>, Constructor<?>>();
+    private static Map<Class<?>, Constructor<?>> class2constuctor = new ConcurrentHashMap<>();
 
     /**
Index: applications/editors/josm/plugins/imagerycache/src/org/mapdb/SnapshotEngine.java
===================================================================
--- applications/editors/josm/plugins/imagerycache/src/org/mapdb/SnapshotEngine.java	(revision 30532)
+++ applications/editors/josm/plugins/imagerycache/src/org/mapdb/SnapshotEngine.java	(revision 30737)
@@ -22,5 +22,5 @@
 
 
-    protected final Map<Snapshot, String> snapshots = new ConcurrentHashMap<Snapshot, String>();
+    protected final Map<Snapshot, String> snapshots = new ConcurrentHashMap<>();
 
 
Index: applications/editors/josm/plugins/imagerycache/src/org/mapdb/StoreAppend.java
===================================================================
--- applications/editors/josm/plugins/imagerycache/src/org/mapdb/StoreAppend.java	(revision 30532)
+++ applications/editors/josm/plugins/imagerycache/src/org/mapdb/StoreAppend.java	(revision 30737)
@@ -4,5 +4,4 @@
 import java.io.IOError;
 import java.io.IOException;
-import java.util.BitSet;
 import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReentrantLock;
@@ -37,6 +36,6 @@
     volatile protected long maxRecid;
 
-    protected LongConcurrentHashMap<Volume> volumes = new LongConcurrentHashMap<Volume>();
-    protected final LongConcurrentHashMap<Long> recidsInTx = new LongConcurrentHashMap<Long>();
+    protected LongConcurrentHashMap<Volume> volumes = new LongConcurrentHashMap<>();
+    protected final LongConcurrentHashMap<Long> recidsInTx = new LongConcurrentHashMap<>();
 
 
@@ -85,5 +84,5 @@
 
             //replay file and rebuild recid index table
-            LongHashMap<Long> recidsTable2 = new LongHashMap<Long>();
+            LongHashMap<Long> recidsTable2 = new LongHashMap<>();
             if(!currentVolume.isEmpty()){
                 currentFileOffset =0;
@@ -405,5 +404,5 @@
             if(!recidsInTx.isEmpty()) throw new IllegalAccessError("Uncommited changes");
 
-            LongHashMap<Boolean> ff = new LongHashMap<Boolean>();
+            LongHashMap<Boolean> ff = new LongHashMap<>();
             for(long recid=0;recid<maxRecid;recid++){
                 long indexVal = recidsTable.getLong(recid*8);
Index: applications/editors/josm/plugins/imagerycache/src/org/mapdb/StoreWAL.java
===================================================================
--- applications/editors/josm/plugins/imagerycache/src/org/mapdb/StoreWAL.java	(revision 30532)
+++ applications/editors/josm/plugins/imagerycache/src/org/mapdb/StoreWAL.java	(revision 30737)
@@ -3,6 +3,4 @@
 import java.io.IOError;
 import java.io.IOException;
-import java.util.concurrent.locks.Lock;
-import java.util.concurrent.locks.ReentrantReadWriteLock;
 
 /**
@@ -31,5 +29,5 @@
     protected long logSize;
 
-    protected final LongConcurrentHashMap<long[]> modified = new LongConcurrentHashMap<long[]>();
+    protected final LongConcurrentHashMap<long[]> modified = new LongConcurrentHashMap<>();
 
 
Index: applications/editors/josm/plugins/imagerycache/src/org/mapdb/TxMaker.java
===================================================================
--- applications/editors/josm/plugins/imagerycache/src/org/mapdb/TxMaker.java	(revision 30532)
+++ applications/editors/josm/plugins/imagerycache/src/org/mapdb/TxMaker.java	(revision 30737)
@@ -18,5 +18,5 @@
     protected final Object lock = new Object();
 
-    protected final LongMap<TxEngine> globalMod = new LongHashMap<TxEngine>();
+    protected final LongMap<TxEngine> globalMod = new LongHashMap<>();
 
 
@@ -59,7 +59,7 @@
 
         protected LongMap<Fun.Tuple2<?, Serializer>> modItems =
-                new LongHashMap<Fun.Tuple2<?, Serializer>>();
+                new LongHashMap<>();
 
-        protected Set<Long> newItems = new LinkedHashSet<Long>();
+        protected Set<Long> newItems = new LinkedHashSet<>();
 
         protected TxEngine(Engine engine) {
Index: applications/editors/josm/plugins/imagerycache/src/org/mapdb/Volume.java
===================================================================
--- applications/editors/josm/plugins/imagerycache/src/org/mapdb/Volume.java	(revision 30532)
+++ applications/editors/josm/plugins/imagerycache/src/org/mapdb/Volume.java	(revision 30737)
@@ -28,6 +28,4 @@
 import java.util.Map;
 import java.util.WeakHashMap;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Future;
 import java.util.concurrent.locks.ReentrantLock;
 import java.util.logging.Level;
Index: applications/editors/josm/plugins/imagerycache/src/org/openstreetmap/josm/plugins/imagerycache/DBTile.java
===================================================================
--- applications/editors/josm/plugins/imagerycache/src/org/openstreetmap/josm/plugins/imagerycache/DBTile.java	(revision 30532)
+++ applications/editors/josm/plugins/imagerycache/src/org/openstreetmap/josm/plugins/imagerycache/DBTile.java	(revision 30737)
@@ -16,7 +16,7 @@
         data = dbTile.data.clone();
         if (dbTile.metaData != null) {
-            metaData = new HashMap<String, String>(dbTile.metaData);
+            metaData = new HashMap<>(dbTile.metaData);
         } else {
-            metaData = new HashMap<String, String>();
+            metaData = new HashMap<>();
         }
         lastModified = dbTile.lastModified;
Index: applications/editors/josm/plugins/imagerycache/src/org/openstreetmap/josm/plugins/imagerycache/TileDAOMapDB.java
===================================================================
--- applications/editors/josm/plugins/imagerycache/src/org/openstreetmap/josm/plugins/imagerycache/TileDAOMapDB.java	(revision 30532)
+++ applications/editors/josm/plugins/imagerycache/src/org/openstreetmap/josm/plugins/imagerycache/TileDAOMapDB.java	(revision 30737)
@@ -19,6 +19,6 @@
     public static boolean dbNotAvailable = false;
 
-    protected HashMap<String, DB> dbs = new HashMap<String, DB>();
-    protected HashMap<String, Map<Long, DBTile>> storages = new HashMap<String, Map<Long, DBTile>>();
+    protected HashMap<String, DB> dbs = new HashMap<>();
+    protected HashMap<String, Map<Long, DBTile>> storages = new HashMap<>();
     private File cacheFolder;
     
