Given a List
of String
s, write a method toSet
that converts the List
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".
assert
that the passed List
is not null
.
Stuck? You may find these lessons helpful: