framework/tests/all-systems/Issue438.java
raw| 1 | // Test case for Issue 438: |
| 2 | // https://github.com/typetools/checker-framework/issues/438 |
| 3 | |
| 4 | import java.util.HashSet; |
| 5 | import java.util.List; |
| 6 | |
| 7 | public class Issue438 { |
| 8 | boolean foo(List<String> list) { |
| 9 | if (list.isEmpty()) { |
| 10 | return new HashSet<>(list).isEmpty(); |
| 11 | } else { |
| 12 | return new HashSet<>(list).contains("test"); |
| 13 | } |
| 14 | } |
| 15 | |
| 16 | int bar(List<String> list) { |
| 17 | return new HashSet<>(list).size(); |
| 18 | } |
| 19 | } |