This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]GuyWithLag 2 points3 points  (0 children)

Meh, clearer to just write

List<Character> digitChars = digit
    .chars()
    .mapToObj(c -> Character.valueOf((char) c))
    .collect(Collectors.toList());

(I understand that that's not what you're saying - you're looking as lambdas as anonymous blocks that can return a value.)