How to get the first/last object from lv_group?

Description

What MCU/Processor/Board and compiler are you using?

Renesas RA6M2, GCC arm_none_eabi_9-2019-q4

What LVGL version are you using?

#7.7.2

What do you want to achieve?

I want to know if the object that is currently focused is the first/last in a lv_group.

What have you tried so far?

For now, I get the current object focused, I move the focus to the next/previous object with lv_group_focus_next/prev and I compare the values.

Code to reproduce

The lv_group is created with :

ext->focus_group = lv_group_create();
lv_group_set_wrap(ext->focus_group, false);

The code to compare focused objects is the following :

lv_obj_t *obj = lv_group_get_focused(ext->focus_group);
/* Set focus to prev child */
lv_group_focus_prev(ext->focus_group);
if (obj == lv_group_get_focused(ext->focus_group)) {
    /* Do something */
}

OR

lv_obj_t *obj = lv_group_get_focused(ext->focus_group);
/* Set focus to next child */
lv_group_focus_next(ext->focus_group);
if (obj == lv_group_get_focused(ext->focus_group)) {
    /* Do something */
}