How to use :: in test script

hi,

how to use this (String::valueOf) notation in test script
String extraRules = IntStream.range(0, 100).mapToObj(String::valueOf).collect(joining(" < "));

Description Resource Path Location Type
unexpected token: : @ line 24, column 61.

Check your groovy compiler version here:

Window > Katalon Studio Preferences > Groovy > Compiler:

According to the Groovy documentation, that notation is only supported in Groovy 3+:

try

String.&valueOf

.& is called “Method pointer operator” in Groovy

https://docs.groovy-lang.org/latest/html/documentation/#method-pointer-operator

Hi,

thanks @kazurayam, this .& was the key, works now