find_if algorithm and tests