HashSet
SC-W1020A duplicate element exists in the HashSet
. This adds no value as the structure HashSet
always maintains elements that are unique and distinct from each other and is usually a result of a human-error. It is suggested that you remove such duplicate elements.
val names = immutable.HashSet[String]("mark", "jason", "john", "mark") // duplicate element "mark"
All keys should be unique.
val freq = immutable.HashSet[String]("mark", "jason", "john") // duplicate element "mark" removed