FlowElement flowElement = model.getMainProcess().getFlowElement("task");
assertNotNull(flowElement);
assertTrue(flowElement instanceof UserTask);
assertEquals("task", flowElement.getId());
ProcessValidator processValidator = new ProcessValidatorFactory().createDefaultProcessValidator();
List<ValidationError> errors = processValidator.validate(model);
assertNotNull(errors);
assertEquals(2, errors.size());
}