/* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ import java.util.HashMap; import java.util.Map; class MapTest { public void keySet_linear(Map map) { for (String name : map.keySet()) {} } public void entrySet_linear(Map map) { for (Map.Entry entry : map.entrySet()) {} } public void values_linear(Map map) { map.put("hi", 0); for (Integer name : map.values()) {} } public void putAll_linear(Map map) { Map newmap = new HashMap<>(); newmap.putAll(map); for (Integer name : newmap.values()) {} } boolean containsNullValue_linear(HashMap keyMap) { return keyMap.containsValue(null); } }