Code example for LinkedHashMap

0
        private final Lock lock = new ReentrantLock();
        private final Map<BytesKey, OpItem> map;
 
 
        MessageIndexMap() { 
            this.map = new LinkedHashMap<BytesKey, OpItem>();
        } 
 
 
        @Override 
        public void put(BytesKey key, OpItem opItem) {
            this.lock.lock();
            try { 
                this.map.put(key, opItem);
            } 
            finally { 
                this.lock.unlock();
            } 
        }