This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
this has no effect as far as i can see, you have a set reference that has no type safe protection. The compiler sees (Set vals) and thinks it can put anything in it, which it can. As at runtime the jvm sees TreeSet as at runtime TreeSet<String> does not exist only TreeSet exists on the heap.
Remember this type of type safety is compile only, but you have undone the compile time safety by making the ref like that.