Java examples for Collection Framework:HashSet
How to get a synchronized Set from HashSet using synchronizedSet method of Collections class
import java.util.HashSet; import java.util.Collections; import java.util.Set; public class Main { public static void main(String[] args) { HashSet hashSet = new HashSet(); /*from w w w. j a v a 2 s.c om*/ Set set = Collections.synchronizedSet(hashSet); } }