public final void add( final int key, final T value){
		if ( size == 0 ){
			if (keys.length >0){
				keys[0] = key;
				values[0] = value;
			} else{
				keys = new int[]{key};
				values = new Object[]{value};
			}
			size = 1;
			return;
		}
		// Find index where to put it:
		final int index = closestIndex(key);
		int ref = keys[index];
		if ( ref == key ){
			values[index] = value;
			// size stays.
			return;
		}
		// TODO: (below) more efficient (contract).
		else if ( ref > key){
			int k = index -1;
			while (k>=0){
				if (keys[k] <key ) break;
				ref = keys[k];
				k--;
			}
			// k should be one less than the index to add to
			addAtIndex( k+1, key, value);
		}
		else{
			// ref < key
			int k = index + 1;
			while (k<size){
				if (keys[k] >key ) break;
				ref = keys[k];
				k++;
			}
			// k should be one greater than the index to add to
			addAtIndex( k, key, value);
		}
	}