Files
kotlin-fork/nj2k/testData/newJ2k/javaStreamsApi/collectStream.java
T
Ilya Kirillov 2bd5a1f196 New J2K: separate nullability inference from common one & nullability bug fixes
It will be needed for structure mutability inference

#KT-21467 fixed
#KT-32609 fixed
#KT-32572 fixed
#KT-24677 fixed
2019-07-25 14:34:35 +03:00

17 lines
619 B
Java
Vendored

// RUNTIME_WITH_FULL_JDK
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
class Test {
public void main(List<String> lst) {
List<String> toList = lst.stream().collect(Collectors.toList());
Set<String> toSet = lst.stream().collect(Collectors.toSet());
long count = lst.stream().count();
boolean anyMatch = lst.stream().anyMatch(v -> v.isEmpty());
boolean allMatch = lst.stream().allMatch(v -> v.isEmpty());
boolean noneMatch = lst.stream().noneMatch(v -> v.isEmpty());
lst.stream().forEach(v -> System.out.println(v));
}
}