import java.util.Map; import org.checkerframework.checker.nullness.qual.*; class MapLoop { void test1(Map map) { for (Map.Entry<@KeyFor("map") String, String> entry : map.entrySet()) {} } void test2(Map map) { for (Map.Entry entry : map.entrySet()) {} } void test3(Map map) { for (Map.Entry entry : map.entrySet()) {} for (Object val : map.values()) {} } }