Useful methods for Scala collections