How to add workflow to newly created workflow scheme using Java API in Jira 8

Need alternative of method named “addWorkflowToScheme(GenericValue , String , String )” defined in com.atlassian.jira.workflow.WorkflowSchemeManager so as to pass parameter of type “Scheme Object instead of GenericValue”

getScheme(id) of com.atlassian.jira.workflow.workflowSchemeManager.java is deprecated since v5.0.
We used getSchemeObject(Long).
But this method returns Scheme Object instead of GenericValue.
When we try to add Workflow to this retrieved Scheme object from ‘getSchemeObject(Long)’,
there is no method available in WorkflowSchemeManager to use Scheme Object. As currently available method i.e. addWorkflowToScheme(org.ofbiz.core.entity.GenericValue scheme, String workflowName, String issueTypeId) needs Generic Value type object.

Kindly suggest a solution which can work !