void () { final Map<String, String> <warning descr="Contents of collection 'anotherMap' are queried, but never updated">anotherMap</warning> = new HashMap<String, String>(); final SortedMap<String, String> map = new TreeMap<String, String>(anotherMap); final Iterator<String> it = map.keySet().iterator(); while(it.hasNext()){ Object o = it.next(); } }