Removing use of Collections.newSetFromMap, which isn't in Java 5.