class GroupResolversImpl implements GroupResolvers {

    @Override
    public DataFetcher<Group> createGroupDataFetcher() {
        return environment -> {
            long userId = util.getLongArg(environment, "userId", util.getDefaultUserId());
            long parentGroupId = util.getLongArg(environment, "parentGroupId", GroupConstants.DEFAULT_PARENT_GROUP_ID);
            String className = util.getStringArg(environment, "className");
            long classPK = util.getLongArg(environment, "classPK");
            long liveGroupId = util.getLongArg(environment, "liveGroupId", GroupConstants.DEFAULT_LIVE_GROUP_ID);
            Map<Locale, String> nameMap = util.getTranslatedArg(environment, "nameMap");
            Map<Locale, String> descriptionMap = util.getTranslatedArg(environment, "descriptionMap");
            int type = util.getIntArg(environment, "type", GroupConstants.TYPE_SITE_OPEN);
            boolean manualMembership = util.getBooleanArg(environment, "manualMembership");
            int membershipRestriction = util.getIntArg(environment, "membershipRestriction");
            String friendlyURL = util.getStringArg(environment, "friendlyURL");
            boolean site = util.getBooleanArg(environment, "site");
            boolean inheritContent = util.getBooleanArg(environment, "inheritContent", true);
            boolean active = util.getBooleanArg(environment, "active", true);
            ServiceContext serviceContext = new ServiceContext();

            return groupLocalService.addGroup(
                    userId,
                    parentGroupId,
                    className,
                    classPK,
                    liveGroupId,
                    nameMap,
                    descriptionMap,
                    type,
                    manualMembership,
                    membershipRestriction,
                    friendlyURL,
                    site,
                    inheritContent,
                    active,
                    serviceContext);
        };
    }

}