T8068430.java revision 3014:a3dd196e5341
1212332Semax/* 2212332Semax * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. 3212332Semax * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4212332Semax * 5212332Semax * This code is free software; you can redistribute it and/or modify it 6266084Sian * under the terms of the GNU General Public License version 2 only, as 7266084Sian * published by the Free Software Foundation. 8266084Sian * 9266084Sian * This code is distributed in the hope that it will be useful, but WITHOUT 10266084Sian * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11266084Sian * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12266084Sian * version 2 for more details (a copy is included in the LICENSE file that 13266084Sian * accompanied this code). 14266084Sian * 15266084Sian * You should have received a copy of the GNU General Public License version 16266084Sian * 2 along with this work; if not, write to the Free Software Foundation, 17266084Sian * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18266084Sian * 19266084Sian * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20283404Sian * or visit www.oracle.com if you need additional information or have any 21212332Semax * questions. 22212332Semax */ 23266084Sian 24245999Sian/* 25212332Semax * @test 26266084Sian * @bug 8068430 8069545 27266084Sian * @summary structural most specific and stuckness 28266084Sian */ 29212332Semax 30266328Sianimport java.util.HashMap; 31266328Sianimport java.util.Map; 32266328Sian 33266084Sianpublic class T8068430 { 34266328Sian public static void main(String[] args) { 35266328Sian Map<Integer, String> mp = new HashMap<>(); 36266331Sian mp.put(1, "a"); 37266328Sian mp.put(2, "b"); 38266328Sian mp.put(3, "c"); 39266328Sian mp.put(4, "d"); 40266328Sian System.out.println(mp.entrySet().stream().reduce(0, 41266328Sian (i, e) -> i + e.getKey(), 42266328Sian (i1, i2) -> i1 + i2)); 43266328Sian } 44266328Sian} 45266084Sian