java set to list

Java
// Java program to demonstrate conversion of 
// Set to list using stream 
import java.util.*; 
import java.util.stream.*; 
  
class Test { 
  public static void main(String[] args) { 
  
    // Creating a hash set of strings 
    Set<String> s = new HashSet<String>(); 
    s.add("Geeks"); 
    s.add("for"); 
  
    List<String> aList = s.stream().collect(Collectors.toList()); 
  
    for (String x : aList) 
      System.out.println(x); 
  } 
} 

Source

Also in Java: