is not this wasteful couldn t you just do list componentname  componentlist cachedconfigs get s if  componentlist null componentlist new arraylist cachedconfigs put s  componentlist componentlist add componentname so you just do one lookup and if needed one insert of the list 