mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-21 04:50:58 +07:00
14 lines
371 B
Java
14 lines
371 B
Java
// "Adapt lambda return using 'toPath()'" "true-preview"
|
|
import java.io.File;
|
|
import java.nio.file.Path;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Stream;
|
|
|
|
class Demo {
|
|
Map<Path, Long> fileSizes(List<File> files) {
|
|
return files.stream().<caret>collect(Collectors.toMap(f -> f, f -> f.length()));
|
|
}
|
|
}
|