class WorkflowSpecificationsHandler {

    protected WorkflowSpecifications mapWorkflowsToWorkflowSpecifications(List<Workflow> workflows) {
        if (workflows == null || workflows.isEmpty()) {
            return null;
        }
        WorkflowSpecifications workflowSpecifications = new WorkflowSpecifications();
        List<WorkflowSpecificationList> workflowSpecificationList = new ArrayList<>();

        for (Workflow workflow : workflows) {
            WorkflowSpecificationList workflowSpecificationListItem = new WorkflowSpecificationList();
            WorkflowSpecification workflowSpecification = new WorkflowSpecification();
            workflowSpecification.setArtifactInfo(buildArtifactInfo(workflow));
            workflowSpecification.setActivitySequence(buildActivitySequence(workflow));
            workflowSpecification.setWorkflowInputParameters(buildWorkflowInputParameters(workflow));
            workflowSpecificationListItem.setWorkflowSpecification(workflowSpecification);
            workflowSpecificationList.add(workflowSpecificationListItem);
        }
        workflowSpecifications.setWorkflowSpecificationList(workflowSpecificationList);
        return workflowSpecifications;
    }

}