diff --git a/src/main/scala/stdlib/Sets.scala b/src/main/scala/stdlib/Sets.scala index 5a685d89..6d940a80 100644 --- a/src/main/scala/stdlib/Sets.scala +++ b/src/main/scala/stdlib/Sets.scala @@ -82,11 +82,11 @@ object Sets extends FlatSpec with Matchers with org.scalaexercises.definitions.S aNewSet.size should be(res2) } - /** Set elements can be removed with a tuple: + /** Multiple elements can be removed from a Set using the overloaded - method: */ - def tupleRemovingSets(res0: Boolean, res1: Boolean, res2: Int) { + def multiRemovingSets(res0: Boolean, res1: Boolean, res2: Int) { val mySet = Set("Michigan", "Ohio", "Wisconsin", "Iowa") - val aNewSet = mySet - ("Michigan", "Ohio") // Notice: single '-' operator for tuples + val aNewSet = mySet - ("Michigan", "Ohio") // Notice: single '-' operator can remove multiple elements, as many as you want because the method is varadiac aNewSet.contains("Michigan") should be(res0) aNewSet.contains("Wisconsin") should be(res1) diff --git a/src/test/scala/stdlib/SetsSpec.scala b/src/test/scala/stdlib/SetsSpec.scala index 47d58fd2..8b498b08 100644 --- a/src/test/scala/stdlib/SetsSpec.scala +++ b/src/test/scala/stdlib/SetsSpec.scala @@ -75,10 +75,10 @@ class SetsSpec extends Spec with Checkers { ) } - def `we can remove multiple members with tuples` = { + def `we can remove multiple members with the overloaded - method` = { check( Test.testSuccess( - Sets.tupleRemovingSets _, + Sets.multiRemovingSets _, false :: true :: 2 :: HNil ) )