@SuppressWarnings({ "unchecked" })

@Test
public void fetchingExistingWorkflowWorksWithAllIncludes() {
  WorkflowInstance instance = mock(WorkflowInstance.class);
  EnumSet<WorkflowInstanceInclude> includes = EnumSet.allOf(WorkflowInstanceInclude.class);
  when(workflowInstances.getWorkflowInstance(42, includes, 10L)).thenReturn(instance);
  ListWorkflowInstanceResponse resp = mock(ListWorkflowInstanceResponse.class);
  when(listWorkflowConverter.convert(eq(instance), any(Set.class))).thenReturn(resp);
  ListWorkflowInstanceResponse result = resource.fetchWorkflowInstance(42,
      "actions,currentStateVariables,actionStateVariables,childWorkflows", 10L).readEntity(ListWorkflowInstanceResponse.class);
  verify(workflowInstances).getWorkflowInstance(42, includes, 10L);
  assertEquals(resp, result);
}