Most concise way to convert a Set<T> to a List<T>

Viewed 222236

For example, I am currently doing this:

Set<String> setOfTopicAuthors = ....

List<String> list = Arrays.asList( 
    setOfTopicAuthors.toArray( new String[0] ) );

Can you beat this ?

6 Answers
List<String> list = new ArrayList<String>(listOfTopicAuthors);
List<String> l = new ArrayList<String>(listOfTopicAuthors);
Related