import java.util.*; class Test { Set st = new HashSet();
Integer arr[]={1,1,2,2,4,8}; for (Integer it : arr) { st.add(it); System.out.println(st); }