Task newTask = taskService.newTask();
taskService.saveTask(newTask);
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("customSerializable", new CustomSerializable());
variables.put("failingSerializable", new FailingSerializable());
taskService.setVariables(newTask.getId(), variables);
// when
List<HistoricVariableInstance> variableInstances = historyService.createHistoricVariableInstanceQuery()
.disableCustomObjectDeserialization()