### Question:
ProcessInstanceExpressionsEvaluator { public Map<String, Serializable> evaluate(ProcessInstanceAccessor instance, final Map<Expression, Map<String, Serializable>> expressions, boolean atProcessInstanciation) throws BPMEngineException, BPMExpressionEvaluationException { if (atProcessInstanciation) { return evaluateExpressionsAtProcessInstanciation(instance.getId(), expressions); } else if (instance.isArchived()) { return evaluateExpressionsOnCompleted(instance.getId(), expressions); } else { return evaluateExpressionsOnProcessInstance(instance.getId(), expressions); } } ProcessInstanceExpressionsEvaluator(ExpressionEvaluatorEngineClient engineEvaluator); Map<String, Serializable> evaluate(ProcessInstanceAccessor instance,
            final Map<Expression, Map<String, Serializable>> expressions,
            boolean atProcessInstanciation);  }### Answer:
@Test public void testEvaluateExpressionOnCompletedProcessInstance() throws Exception { when(processInstance.getId()).thenReturn(2L); when(processInstance.isArchived()).thenReturn(true); when(engineEvaluator.evaluateExpressionsOnCompletedProcessInstance(2L, someExpressions)) .thenReturn(aKnownResultSet()); Map<String, Serializable> evaluated = evaluator.evaluate(processInstance, someExpressions, false); assertEquals(aKnownResultSet(), evaluated); }