mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-29 09:49:56 +07:00
StreamToLoop tests grouped
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
// "Fix all 'Stream API call chain can be replaced with loop' problems in file" "true"
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.*;
|
||||
|
||||
public class Main {
|
||||
public long testCount(List<String> list) {
|
||||
return list.stream().distinct().c<caret>ount();
|
||||
}
|
||||
|
||||
private static List<Object> testToList(List<? extends Number> numbers) {
|
||||
return numbers.stream().distinct().collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(testToList(Arrays.asList(1,2,3,5,3,2,2,2,1,1,4,3)));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user