I have a class with `Map`s from `K`s to `Set<V>`s, for several different `V`s. I'd like to use a generic factory ala:

```
protected static <T> Set<T> SetFactory(int size) {
        return new HashSet<T>(size);
}

```

to do something like

```
for (K key : keySet) map.put(key, SetFactory());

```

and have the generic part work (I get a compile error, type mismatch between `Set<Object>` and `Set<V>`), like it does with `Set<V> x = SetFactory();`

Are there alternatives to passing a `Class<V>` argument to `SetFactory()`?