code: public static List<String> getRepeat(List<String> list) {
          List<String> rtn = new ArrayList<>();
          Set<String> idSet = new HashSet<>();
  
          for (String id : list) {
              if (idSet.contains(id)) {
                  rtn.add(id);
              } else {
                  idSet.add(id);
              }
          }
  
          return rtn;
      }
docs: if the list contains repeated string, return the repeated string
  this function is used to check whether bolt/spout has a duplicate id