Junior — Senior
Converting a list of strings into a set of unique values
livecode
Task condition
It is necessary to convert a list of strings into a set, leaving only unique elements.
import java.util.Collection;
public class JetbulbInterview {
public static void main(String[] args) {
Collection<String> source = Collections.singletonList("hello world");
Set<String> uniqueSet = new HashSet<>(source);
}
}