private void checkVariables(VariableMap map, int expectedSize) { IList <HistoricVariableInstance> variables = engineRule.HistoryService.createHistoricVariableInstanceQuery().orderByVariableName().asc().list(); assertEquals(expectedSize, variables.Count); assertEquals(variables.Count, map.size()); foreach (HistoricVariableInstance instance in variables) { assertTrue(map.containsKey(instance.Name)); object instanceValue = instance.TypedValue.Value; object mapValue = map.getValueTyped(instance.Name).Value; if (instanceValue == null) { assertNull(mapValue); } else if (instanceValue is sbyte[]) { assertTrue(Arrays.Equals((sbyte[])instanceValue, (sbyte[])mapValue)); } else { assertEquals(instanceValue, mapValue); } } }