mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-18 08:50:57 +07:00
13 lines
329 B
Java
13 lines
329 B
Java
// "Replace Stream API chain with loop" "true-preview"
|
|
|
|
import java.util.*;
|
|
|
|
public class Main {
|
|
private static long test(List<?> list) {
|
|
return list.stream().skip(list.size()/2).distinct().cou<caret>nt();
|
|
}
|
|
|
|
public static void main(String[] args) {
|
|
System.out.println(test(Arrays.asList(1,2,3,3,2,1,1,2,3)));
|
|
}
|
|
} |