@Override
    public V put(K key, V value) {
        V oldValue = null;
        MapEntry<K, V> pair = new MapEntry<K, V>(key, value);
        int index = Math.abs(key.hashCode()) % SIZE;
        if(buckets[index] == null) {
            buckets[index] = new LinkedList<MapEntry<K, V>>();
            LinkedList<MapEntry<K, V>> bucket = buckets[index];
            bucket.add(pair);
        }
        LinkedList<MapEntry<K, V>> bucket = buckets[index];
        if(buckets[index].size() > 0) {
            for(MapEntry<K, V> entry = bucket.get(0); entry != null; entry = entry
                    .getNextEntry()) {
                if(entry.getKey().equals(key)) {
                    oldValue = entry.getValue();
                    entry.setValue(value);
                    return oldValue;
                }
            }
            bucket.add(pair);
            int i = bucket.indexOf(pair);
            if(i > 0) {
                bucket.get(i - 1).setNextEntry(pair);
            }
            return pair.getValue();
        }
        return oldValue;
    }