added collect test for toMap and toSet