Map map = Maps.newHashMap(); map.put(\"test\",\"123\"); map.put(\"fuyou001\",\"456\"); map.put(\"id\",1
Functions in general should not have side effects; that's your real problem.
Function
That said, if you insist on applying the transformation immediately, do a copy: Lists.newArrayList(Lists.transform(list, function)).
Lists.newArrayList(Lists.transform(list, function))