Is guava's ImmutableXXX really immutable?
问题 I have been using guava for some time now and truly trusted it, until I stumbled of an example yesterday, which got me thinking. Long story short, here it is: public static void testGuavaImmutability(){ StringBuilder stringBuilder = new StringBuilder("partOne"); ImmutableList<StringBuilder> myList = ImmutableList.of(stringBuilder); System.out.println(myList.get(0)); stringBuilder.append("appended"); System.out.println(myList.get(0)); } After running this you can see that the value of an entry