Instead of hard-coding 0, you could use conn.getAdminService().getSecurityRoles().systemGroupId