This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
For backward compatability, you are allowed to declare references to classes with generics, and instantiate classes with generics, without specifying the generic type.... However, it will generate a warning error.
The above code will throw a ClassCastException when iterating over stringSet, because it will cast the Integer object to a String.
By warning you the compiler tells you that the code may cause problems at some stage. Therefore, in an ideal situation, you make sure there are no warnings. Sometimes you can't however; in those cases it is vital that you document why the warning is safe to ignore. If you can't then it isn't safe and you should prevent the warning.