This is the code that returns the object that has the maximum date starting from a stream, I would like to return a list to me, assuming that there are more records.
How should it be changed?
Comparator<DatoStoricoNominativo> comparator =
Comparator.comparing( DatoStoricoNominativo::getDataFine );
DatoStoricoNominativo dsna = dsn.stream().max(comparator).get();