code: 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();
      }
docs: Removes the duplicate node list.
  
  @param list
  the list
  @return the int