我可以使用并行流还是有其他方法

can I Use parallel stream or is there any other way

我想问下下面这段代码怎么写groovy 非常感谢;)

  List < String > nums = ['a','b']

  Map<String, Long> counts = nums.parallelStream()
  .collect( Collectors.groupingBy(k -> k.toLowerCase(), 
  Collectors.counting()) );          
              


Output in java: {a:1,b:1}

I tried using the same but it gives error below:
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
/home/cg/root/492337/main.groovy: 7: unexpected token: -> @ line 7, column 43.
lect( Collectors.groupingBy(k -\> k.toLow
import java.util.stream.Collectors

List < String > nums = ['a','b']

Map<String, Long> counts = nums.parallelStream()
  .collect( Collectors.groupingBy( {k -> k.toLowerCase()}, Collectors.counting()) )