mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-29 08:20:55 +07:00
16 lines
427 B
Java
16 lines
427 B
Java
// "Collapse loop with stream 'collect()'" "true-preview"
|
|
|
|
import java.io.BufferedReader;
|
|
import java.io.IOException;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.stream.Collectors;
|
|
|
|
public class Main {
|
|
List<String> test(BufferedReader br) throws IOException {
|
|
List<String> result;
|
|
/*comment*/
|
|
result = br.lines().map(String::trim).collect(Collectors.toList());
|
|
return result;
|
|
}
|
|
} |