| 1 |
// Test case for issue #870: https://github.com/typetools/checker-framework/issues/870 |
| 2 |
|
| 3 |
import java.util.stream.Stream; |
| 4 |
import java.util.zip.ZipEntry; |
| 5 |
import java.util.zip.ZipFile; |
| 6 |
|
| 7 |
public class Issue870 { |
| 8 |
public static Stream<? extends ZipEntry> entries(ZipFile zipFile) { |
| 9 |
return zipFile.stream() |
| 10 |
.filter(entry -> !entry.isDirectory() && entry.getName().endsWith(".xml")); |
| 11 |
} |
| 12 |
|
| 13 |
public static Stream<? extends ZipEntry> entries2(ZipFile zipFile) { |
| 14 |
return zipFile.stream() |
| 15 |
.filter( |
| 16 |
(ZipEntry entry) -> |
| 17 |
!entry.isDirectory() && entry.getName().endsWith(".xml")); |
| 18 |
} |
| 19 |
} |