class RangeSearchBST extends RedBlackBSTWithNoExtraMemory<Key, Val> {

    public List<Key> search(Key lo, Key hi) {
        if (lo == null || hi == null || lo.compareTo(hi) > 0)
            throw new IllegalArgumentException("input is not valid");
        List<Key> result = new ArrayList<>();
        search(root, lo, hi, result);
        return result;
    }

}