Files
2022-12-23 13:26:29 +00:00

10 lines
322 B
Java

// "Collapse loop with stream 'findFirst()'" "true-preview"
import java.util.List;
public class Main {
public int testPrimitiveMap(List<String> data) {
/*ten*/
return data.stream().filter(str -> str.startsWith("xyz")).mapToInt(String::length).filter(len -> len /*bigger*/ > 10).findFirst().orElse(0);
}
}