Does this test fail if you return Set<Type> as is was before?. I tried something similar and the test did not fail. I'm suspecting something like type erasure in Java going on.