@CheckReturnValue
    public EmoteManager setRoles(Set<Role> roles)
    {
        if (roles == null)
        {
            withLock(this.roles, List::clear);
        }
        else
        {
            Checks.notNull(roles, "Roles");
            roles.forEach((role) ->
            {
                Checks.notNull(role, "Roles");
                Checks.check(role.getGuild().equals(getGuild()), "Roles must all be from the same guild");
            });
            withLock(this.roles, (list) ->
            {
                list.clear();
                roles.stream().map(Role::getId).forEach(list::add);
            }
@ CheckReturnValue public EmoteManager setRoles ( Set < Role > roles ) { if ( roles == null ) { withLock ( this . roles , List :: clear ) ; } else { Checks . notNull ( roles , "Roles" ) ; roles . forEach ( ( role ) -> { Checks . notNull ( role , "Roles" ) ; Checks . check ( role . getGuild ( ) . equals ( getGuild ( ) ) , "Roles must all be from the same guild" ) ; } ) ; withLock ( this . roles , ( list ) -> { list . clear ( ) ; roles . stream ( ) . map ( Role :: getId ) . forEach ( list :: add ) ; }
Sets the <b><u>restriction roles</u></b> of the selected {@link net.dv8tion.jda.core.entities.Emote Emote}.
<br>If these are empty the Emote will be available to everyone otherwise only available to the specified roles.

<p>An emote's restriction roles <b>must not</b> contain {@code null}!

@param  roles
The new set of {@link net.dv8tion.jda.core.entities.Role Roles} for the selected {@link net.dv8tion.jda.core.entities.Emote Emote}
to be restricted to, or {@code null} to clear the roles

@throws IllegalArgumentException
If any of the provided values is {@code null}

@return EmoteManager for chaining convenience