class DepartmentUtil {

  public static List<SysDeptTree> wrapDeptListToTree(List<SysDept> sysDeptList,
                                                     List<SysDeptSelect> sysDeptSelects) {
    sysDeptSelects.clear();
    List<SysDeptTree> records = new ArrayList<>();
    for (int i = 0; i < sysDeptList.size(); i++) {
      SysDept dept = sysDeptList.get(i);
      records.add(new SysDeptTree(dept));
    }
    List<SysDeptTree> sysOrgTreeList = findChildren(records, sysDeptSelects);
    setEmptyChildrenAsNull(sysOrgTreeList);

    return sysOrgTreeList;
  }

}