I have the following code:
private static final ImmutableMultimap<String, String> namesToAddress;
public static List<String> getAddresses(String name){
return ImmutableList.copyOf(namesToAddress.get(name));
}
My question is wheter the defensive copyOf() here is necessary, as the get() returns an immutable list anyway?
Note I am using ImmutableMultiimap from Google Guava.
Thanks.