@Test
public void listWorkflowInstances() {

  List<WorkflowInstance> result  = asList(constructWorkflowInstanceBuilder().build());
  QueryWorkflowInstances query = mock(QueryWorkflowInstances.class);
  when(workflowInstanceDao.queryWorkflowInstances(query)).thenReturn(result);
  assertEquals(result, service.listWorkflowInstances(query));
}