Don't disable BB code when using code tags. It's one of the little check boxes below the text field when you type a post.
Note: I'm ignoring any other potential subclasses in my following explanation. A Set<SuperClass> can store instances of SuperClass and SubClass. A HashSet<SubClass> can only store instances of SubClass.
If you now assign a HashSet<SubClass> object to a Set<SuperClass> reference, the compiler can no longer prevent you from adding SuperClass instances.
The solution is quite simple: use bounded wildcards:
Since SubClass extends SuperClass, it matches the wildcard. The compiler does not allow you to add anything to a collection with a bounded wildcard that uses extends (where "?" is treated equally to "? extends Object") since it can't tell which subclass the ? actually represents. Therefore this assignment is safe again.