variables.put("aVariable", "test");
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("taskAssigneeProcess", variables);
VariableInstanceQuery query = runtimeService.createVariableInstanceQuery().variableName("aVariable");
VariableInstance variable = query.singleResult();
assertEquals(ValueType.STRING.getName(), variable.getTypeName());
runtimeService.setVariable(processInstance.getId(), "aVariable", new SerializableVariable("foo"));
variable = query.singleResult();
assertEquals(ValueType.OBJECT.getName(), variable.getTypeName());