@Test
public void failure() {

    assert executionTrace != null;
    try (ModuleInterpretation moduleInterpretation = testCaseBuilder("successfulExecution").build()) {
        Props props = moduleInterpretation.toSimpleModuleInterpreterProps(MODULE_ID, bitSetOf(), bitSetOf(0));
        TestActorRef<SimpleModuleInterpreterActor> actorRef = TestActorRef.create(
            moduleInterpretation.getActorSystem(), props, moduleInterpretation.getSupervisor());
        // Send a SimpleModuleExecutorResult indicating failure, similar to Class#newInstance().
        SimpleModuleExecutorResult executionResult = new SimpleModuleExecutorResult.Builder(
                Name.qualifiedName(SimpleModuleExecutorResult.class.getName()))
            .setException(new ExecutionException(EXPECTED_MSG))
            .build();
        try {
            // Unfortunately, receive() bypasses the compile-time exception checking
            actorRef.receive(executionResult);
            Assert.fail();
        } catch (Exception exception) {
            InterpreterException interpreterException = (InterpreterException) exception;
            Assert.assertEquals(interpreterException.getExecutionTrace(), ExecutionTrace.copyOf(executionTrace));
            ExecutionException cause = (ExecutionException) interpreterException.getCause();
            Assert.assertEquals(cause.getMessage(), EXPECTED_MSG);
        }
    }
}