hi! Try to use this stream, but i got NoSuchElementException on
var scores = findAllByBarcode
.stream()
.iterator()
.next()
.getMpProductFeedbacks()
.stream()
.filter(mpProductFeedback -> mpProductFeedback.getId()==mpProductFeedbackId)
.iterator()
.next()
.getMpPersonScores()
.stream()
.map(mpPersonScore -> {
var score = new ScoreType();
score.setUserScore(mpPersonScore.getMpPersonScore());
score.setUser(mpPersonScore.getMpPersonLogin());
score.setUserComment(mpPersonScore.getMpPersonComment());
return score;
})
.toList();
got exception after part
filter(mpProductFeedback -> mpProductFeedback.getId()==mpProductFeedbackId)
.iterator()
.next()
tried to use orElse, but it works only with .equals i already have == between two longs.
Assuming we're dealing with nested Collections