но choice.stream().collect(Collectors.toList()); возвращает пустой списокКто-нибудь знает почему?
Код: Выделить всё
//returns poll with list of choices
public Poll accessPoll(String pollId) {
return pollRepository.findById(pollId).orElseThrow(
() -> new IllegalStateException(String.format("No poll found for the ID: %s.", upperCasePollId)));
}
List choices = pollManager.accessPoll(pollId).getChoices(); //returns list of choices
List choices1 = pollManager.accessPoll(pollId).getChoices()
.stream().collect(Collectors.toList()); //returns empty list


Подробнее здесь: https://stackoverflow.com/questions/700 ... empty-list