If oldV
is declared as a Vector<String>
just use the parameterized version of 'LinkedHashSet':
Vector<String> newV = new Vector<String>( new LinkedHashSet<String>(oldV) )
you can also use the annotation @SuppressWarnings
if you just want to get rid of the warnings:
@SuppressWarnings("unchecked")
Vector<String> newV = new Vector<String>( new LinkedHashSet(oldV) );