### Question:
AdHocSubProcessPropertyWriter extends SubProcessPropertyWriter { public void setAdHocCompletionCondition(BaseAdHocCompletionCondition adHocCompletionCondition) { FormalExpression e = bpmn2.createFormalExpression(); ScriptTypeValue s = adHocCompletionCondition.getValue(); e.setLanguage(scriptLanguageToUri(s.getLanguage())); e.setBody(asCData(s.getScript())); process.setCompletionCondition(e); } AdHocSubProcessPropertyWriter(AdHocSubProcess process, VariableScope variableScope, Set<DataObject> dataObjects); void setAdHocActivationCondition(BaseAdHocActivationCondition adHocActivationCondition); void setAdHocOrdering(org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocOrdering value); void setAdHocCompletionCondition(BaseAdHocCompletionCondition adHocCompletionCondition); void setAdHocAutostart(boolean autoStart);  }### Answer:
@Test public void testSetAdHocCompletionCondition() { AdHocCompletionCondition condition = new AdHocCompletionCondition(new ScriptTypeValue("java", "some code")); tested.setAdHocCompletionCondition(condition); FormalExpression expression = (FormalExpression) ((AdHocSubProcess) tested.getFlowElement()).getCompletionCondition(); assertEquals(condition.getValue().getLanguage(), Scripts.scriptLanguageFromUri(expression.getLanguage())); assertEquals(asCData(condition.getValue().getScript()), expression.getBody()); }