| 1 |
import static java.util.Arrays.asList; |
| 2 |
|
| 3 |
import java.util.List; |
| 4 |
import java.util.function.Supplier; |
| 5 |
|
| 6 |
class Issue436 { |
| 7 |
public void makeALongFormConditionalLambdaReturningGenerics(boolean makeAll) { |
| 8 |
// TypeArgInferenceUtil.assignedTo used to try to use the method return rather than the |
| 9 |
// lambda return for those return statements below |
| 10 |
Supplier<List<String>> supplier = |
| 11 |
() -> { |
| 12 |
if (makeAll) { |
| 13 |
return asList("beer", "peanuts"); |
| 14 |
} else { |
| 15 |
return asList("cheese", "wine"); |
| 16 |
} |
| 17 |
}; |
| 18 |
} |
| 19 |
} |