Is it equivalent between
return ImutableMap.copyOf(map);
and
return Collections.unmodifiableMap(new HashMap(map));
return Collections.unmodifiableMap(new LinkedHashMap(map));
And is second way thread-safe?
(ImutableMap from Guava, I try second way because ImmutableMap doesn't support null-value)