@Test
public void testConvertApplicationLastResultComplexSemanticInterpretation()
        throws Exception {

    final XmlExtensionNotificationDataConverter converter = new XmlExtensionNotificationDataConverter();
    final List<LastResult> list = new java.util.ArrayList<LastResult>();
    final Context context = Context.enter();
    context.setLanguageVersion(Context.VERSION_1_6);
    final Scriptable scope = context.initStandardObjects();
    context.evaluateString(scope, "var out = new Object();", "expr", 1,
            null);
    context.evaluateString(scope, "var out = new Object();", "expr", 1,
            null);
    context.evaluateString(scope, "out.order = new Object();", "expr", 1,
            null);
    context.evaluateString(scope, "out.order.topping = 'Salami';", "expr",
            1, null);
    context.evaluateString(scope, "out.order.size = 'medium';", "expr", 1,
            null);
    context.evaluateString(scope, "out.date = 'now';", "expr", 1, null);
    final Object out = scope.get("out", scope);
    final LastResult result = new LastResult("yes", .75f, "voice", out);
    list.add(result);
    final Element element = (Element) converter
            .convertApplicationLastResult(list);
    System.out.println(toString(element));
}