How to change name of workflow scheme associated with the Project using Java API in Jira 8

As in Jira 8, Scheme.java will be made immutable, so set(Name) is deprecated.
Any alernative?