mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-20 20:20:56 +07:00
14 lines
373 B
Java
14 lines
373 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().collect(Collectors.toMap(f -> f.toPath(), f -> f.length()));
|
|
}
|
|
}
|