Tim,
The warning is due to the fact that the Set you defined isn't typed (using Generics). Since you mentioned Generics, I'm guessing you already have your Map defined similar to the following:
If that's the case, then the keySet() method should be returning a Set<
String>. But you are only saving it into an untyped Set reference. By the time you use that Set in the last line, the compiler can't tell it's actually a Set<String>. It can't be sure the operation you're asking for is going to be legal, so it issues the warning.
Try this - it compiles for me:
Hope this helps,
-- Jon