public static int removeDuplicateNodeList(List<String> list) {

        int originCount = list.size();
        // add elements to all, including duplicates
        HashSet<String> hs = new LinkedHashSet<String>();
        hs.addAll(list);
        list.clear();
        list.addAll(hs);

        return originCount - list.size();
    }
public static int removeDuplicateNodeList ( List < String > list ) { int originCount = list . size ( ) ; HashSet < String > hs = new LinkedHashSet < String > ( ) ; hs . addAll ( list ) ; list . clear ( ) ; list . addAll ( hs ) ; return originCount - list . size ( ) ; }
Removes the duplicate node list.

@param list
the list
@return the int