changeset 34682 | fbee345d8615 |
parent 34527 | e3caf3a43d09 |
child 43068 | df01087b2c43 |
--- a/jdk/test/java/util/Map/MapFactories.java Wed Jul 05 21:07:43 2017 +0200 +++ b/jdk/test/java/util/Map/MapFactories.java Fri Dec 11 17:01:01 2015 -0800 @@ -377,4 +377,13 @@ assertEquals(sie.toString(), kvh1.toString()); } + // compile-time test of wildcards + @Test + public void entryWildcardTests() { + Map.Entry<Integer,Double> e1 = Map.entry(1, 2.0); + Map.Entry<Float,Long> e2 = Map.entry(3.0f, 4L); + Map<Number,Number> map = Map.ofEntries(e1, e2); + assertEquals(map.size(), 2); + } + }