Can I guarantee the same result if I use the values() method?
Basically, LinkedHashMap#values returns you a restricted view of the internal structure. And I'd venture to say it must give the same result. It's not explicitly stated in the docs
Returns a Set view of the mappings contained in this map. The set is backed by the map, so changes to the map are reflected in the set, and vice-versa.
but the highlighted excerpt makes me think so.
"The same result" is more than a data collection: it includes the way the data should be iterated (the iterator). "changes to the map are reflected in the set" to me implies that both iterators share one algorithm, which, on the same piece of data, would result in the same behaviour.
keySet(),values()andentrySet()will all three give you internally backed views without additional cost. All of them are just views to the actual internal representation, they all represent the same. In particular, no copies or anything are created, it comes with no real cost. This is documented in Javadoc, please check the documentation first.values()doesn't return entries (as key-value pairs, but only list of values). Your question looks more like "Does LinkedHashMap guarantee same order for entrySet() and values()?" (but I am not sure if that is what you really wanted to ask because I still don't know what is the purpose of LinkedList here)