The filter() method is utilized to select all elements of the set which satisfies a stated predicate.
Method Definition: def filter(p: (A) => Boolean): Set[A]
Return Type: It returns a set containing all the elements of the set which satisfies the given predicate.