code: @Transactional
    public void persist(GroupValue groupValue) {
      Package rootPackage = packageFactory.create(groupValue.getRootPackage());
  
      Map<String, Role> roles =
          groupValue
              .getRoles()
              .stream()
              .map(roleFactory::create)
              .collect(toMap(Role::getName, identity()));
  
      roles.values().forEach(role -> addIncludedRoles(role, roles, groupValue.getName()));
  
      Group group = groupFactory.create(groupValue);
      group.setRootPackage(rootPackage);
      group.setRoles(roles.values());
  
      dataService.add(PACKAGE, rootPackage);
      dataService.add(GROUP, group);
      roles.values().forEach(role -> role.setGroup(group));
  
      dataService.add(ROLE, roles.values().stream());
    }
docs: Creates {@link Group}, {@link Role} and {@link Package} entities and adds them to the
  dataService.
  
  @param groupValue details of the group that should be created