public Map<String, ParamDefinition> generatedStaticWorkflowParamDefs(Workflow workflow) {
    Map<String, ParamDefinition> allParamDefs = new LinkedHashMap<>();
    Map<String, ParamDefinition> defaultWorkflowParams =
        defaultParamManager.getDefaultWorkflowParams();
    // merge default workflow params
    ParamsMergeHelper.mergeParams(
        allParamDefs,
        defaultWorkflowParams,
        ParamsMergeHelper.MergeContext.workflowCreate(ParamSource.SYSTEM_DEFAULT, false));

    // merge defined workflow params
    if (workflow.getParams() != null) {
      ParamsMergeHelper.mergeParams(
          allParamDefs,
          workflow.getParams(),
          ParamsMergeHelper.MergeContext.workflowCreate(ParamSource.DEFINITION, false));
    }
    return allParamDefs;
  }
@Test
  public void testStaticWorkflowParamMerge() {
    workflow.getParams().put("p1", ParamDefinition.buildParamDefinition("p1", "d1"));
    when(defaultParamManager.getDefaultWorkflowParams())
        .thenReturn(singletonMap("p2", ParamDefinition.buildParamDefinition("p2", "d2")));
    Map<String, ParamDefinition> mergedWorkflowParamDefs =
        paramsManager.generatedStaticWorkflowParamDefs(workflow);
    Assert.assertEquals("d1", mergedWorkflowParamDefs.get("p1").asStringParamDef().getValue());
    Assert.assertEquals("d2", mergedWorkflowParamDefs.get("p2").asStringParamDef().getValue());
  }