mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-18 00:20:54 +07:00
assume that null as type of the left side of the assignment is not possible GitOrigin-RevId: c407cdc11e991c8db24ffd683f3b8ea883d41244
18 lines
564 B
Java
18 lines
564 B
Java
import java.util.ArrayList;
|
|
import java.util.Arrays;
|
|
import java.util.List;
|
|
import java.util.function.Function;
|
|
import java.util.stream.Collectors;
|
|
|
|
class MyTest {
|
|
|
|
public List<Integer> someMethod() {
|
|
<error descr="Cannot infer type: 'var' on variable without initializer">var</error> listOfInteger;
|
|
Integer[] arrayOfInteger = {2, 4, 8};
|
|
listOfInteger = Arrays.stream(arrayOfInteger)
|
|
.filter(number -> number >= 4)
|
|
.collect(Collectors.toCollection(ArrayList::new));
|
|
return listOfInteger;
|
|
}
|
|
}
|