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 ( ) ; }
Removes the duplicate node list .