class MapEntry implements Map.Entry<K, V> {

    public V setValue(V val) {
        if (modifiable) {
            V oldVal = this.value;
            this.value = val;
            return oldVal;
        }
        throw new UnsupportedOperationException("The map entry is not modifiable");
    }

    public  MapEntry(K key, V value, boolean modifiable);

}