Fixed a bug of with newHashSets and generic typing.