In Java, When we are working on real time projects.. Generally we came across scenarios like Converting List to Set Object or Vice Versa.
1. Converting a List to a Set Object.
Set<Foo> urSet= new HashSet<Foo>(YourList);
2. Converting a Set to a List Object.