public LruMapNode removeLru() {
        if (size < maxsize) {
            return null;
        }
        size--;
        // unlink the lru from it's bin-queue
        final int bin = (lru.hashCode() & 0xfffffff) % hashbins;
        LruMapNode e = binArray[bin];
        if (e == lru) {
            binArray[bin] = lru.nextInBin;
        } else {
            while (e != null) {
                final LruMapNode prev = e;
                e = e.nextInBin;
                if (e == lru) {
                    prev.nextInBin = lru.nextInBin;
                    break;
                }
            }
        }

        final LruMapNode res = lru;
        lru = lru.next;
        lru.previous = null;
        return res;
    }
Something like LinkedHashMap, but purpose build, less dynamic and memory efficient

@author ab
main/src/main/java/cgeo/geocaching/brouter/util/LruMap.java