class BTreeMap extends AbstractMap<K,V> implements ConcurrentNavigableMap<K,V>, Bind.MapWithModificationListener<K,V> {

    protected final int findChildren(final Object key, final Object[] keys) {
        int left = 0;
        if(keys[0] == null) left++;
        int right = keys[keys.length-1] == null ? keys.length-1 :  keys.length;

        int middle;

        // binary search
        while (true) {
            middle = (left + right) / 2;
            if(keys[middle]==null) return middle; //null is positive infinitive
            if (comparator.compare(keys[middle], key) < 0) {
                left = middle + 1;
            } else {
                right = middle;
            }
            if (left >= right) {
                return  right;
            }
        }

    }

    public  BTreeMap(Engine engine, int maxNodeSize, boolean hasValues, boolean valsOutsideNodes,
                    Serializer defaultSerializer,
                    BTreeKeySerializer<K> keySerializer, Serializer<V> valueSerializer, Comparator<K> comparator);
    public  BTreeMap(Engine engine, long recid, Serializer defaultSerializer);

}