I am unable to handle Unchecked cast warning in my java code :
Set<String> set1=new HashSet<String>();
Object obj="apple";
set1=(Set<String>)obj; // warning Type safety: Unchecked cast from Object to Set<String>
in 3rd line I am getting an warning. How can I remove this. Please suggest. I don't want to use suppress warning code.