public V put(K key, V value) {
        if (getMap().containsKey(key)) {
            // re-adding doesn't change order
            return getMap().put(key, value);
        } else {
            // first add, so add to both map and list
            V result = getMap().put(key, value);
            insertOrder.add(key);
            return result;
        }
    }
Gets the previous key to the one specified using insert order.
This method performs a list search to find the key and is O(n).

@param key the key to find previous for
@return the previous key, null if no match or at start
jphp-runtime/src/php/runtime/common/collections/map/ListOrderedMap.java