public boolean existWorkflowIdInInstances(String workflowId) {
    return withMetricLogError(
        () ->
            withRetryableQuery(
                CHECK_WORKFLOW_ID_IN_INSTANCES_QUERY,
                stmt -> stmt.setString(1, workflowId),
                ResultSet::next),
        "existWorkflowIdInInstances",
        "Failed to check the existence of the workflow instance for workflow id [{}]",
        workflowId);
  }
@Test
  public void testExistWorkflowIdInInstances() {
    assertTrue(instanceDao.existWorkflowIdInInstances(wfi.getWorkflowId()));
    assertFalse(instanceDao.existWorkflowIdInInstances("not-existing"));
  }