I have the following list
listNivelesPersona2 = nivelesPersonaService.findNivelesPersonaConsultaHorario(cvePersona);
I want to recover the last record of the time of entry and exit, I do the following
for (NivelesPersona nivelesPersona : listNivelesPersona2) {
System.out.println("HORARIO" + nivelesPersona.getHorarios().getHorarioEntrada() + " " +nivelesPersona.getHorarios().getHorarioSalida());
}
and it shows me all the entry and exit times that person has
HORARIO11:30 18:00
HORARIO12:00 19:00
HORARIO15:00 20:00
I always want to take the last record, which is the newest one, in this case I'm only interested in the one from 15:00 to 20:00, to show it in view, how can I get that last record?