code: public static List<Category> flattenCategories(List<Category> categoryLst) {
      if (categoryLst == null) {
        return null;
      }
      List<Category> flatCategoryLst = new ArrayList<>();
      flattenCategories(flatCategoryLst, categoryLst);
      return flatCategoryLst;
    }
docs: Puts all categories and their respective children recursively flattened into a list.
  
  @param categoryLst list of parent categories
  @return list of all parent categories and respective recursive children categories