Given a nullable List
of String
s, write a method toSet
that converts it to a Set
of Strings
that
contains all the same String
s in the original list.
So given a List
containing "test", "me", and "test", you would return a Set
containing "test" and "me".
require
that the passed List
is not null
.
Stuck? You may find these lessons helpful: