@Test
public void listWorkflowInstancesWorks() {

  resource.listWorkflowInstances(asList(42L), asList("type"), 99L, 88L, asList("state"),
      asList(WorkflowInstanceStatus.created), "businessKey", "externalId", "", null, null);
  verify(workflowInstances).listWorkflowInstancesAsStream((QueryWorkflowInstances) argThat(allOf(
      hasField("ids", contains(42L)),
      hasField("types", contains("type")),
      hasField("parentWorkflowId", is(99L)),
      hasField("parentActionId", is(88L)),
      hasField("states", contains("state")),
      hasField("statuses", contains(WorkflowInstanceStatus.created)),
      hasField("businessKey", equalTo("businessKey")),
      hasField("externalId", equalTo("externalId")),
      hasField("includeActions", equalTo(false)),
      hasField("includeCurrentStateVariables", equalTo(false)),
      hasField("includeActionStateVariables", equalTo(false)),
      hasField("includeChildWorkflows", equalTo(false)),
      hasField("maxResults", equalTo(null)),
      hasField("maxActions", equalTo(null)))));
}