class PrimitiveLongIntKeyValueArray {

    public boolean putIfAbsent( long key, int value )
    {
        int capacity = naturalKeys.length;
        if ( size == capacity )
        {
            ensureCapacity( (int) Math.floor( growthFactor * capacity ) );
        }

        int index = Arrays.binarySearch( sortedKeys, 0, size, key );
        if ( index >= 0 )
        {
            return false;
        }
        else
        {
            index = -index - 1;
            for ( int i = size; i > index; i-- )
            {
                int j = i - 1;
                sortedKeys[i] = sortedKeys[j];
                sortedValues[i] = sortedValues[j];
            }
            naturalKeys[size] = key;
            naturalValues[size] = value;
            sortedKeys[index] = key;
            sortedValues[index] = value;

            size += 1;
            return true;
        }
    }

    public  PrimitiveLongIntKeyValueArray( int initialCapacity, double growthFactor );
    public  PrimitiveLongIntKeyValueArray( int initialCapacity );
    public  PrimitiveLongIntKeyValueArray();

}