我正在尝试在名为的ArrayList上执行以下流操作parts:
parts
.stream()
.map(t -> t.toLowerCase())
.distinct()
.sorted()
.collect(Collectors.toList());
Run Code Online (Sandbox Code Playgroud)
其中parts包含这样的字符串:
Adventures
in
Disneyland
Two
blondes
were
going
to
Disneyland
....
Run Code Online (Sandbox Code Playgroud)
除了查看调试器之外,parts根本没有改变.不确定我是否错过了这个过程的一些步骤?