@Test
@SuppressWarnings("unchecked")
public void yieldMapValue() throws ScriptException {

    Object result = new JavaScript("test","x = { foo: 'bar'}").exec(scope);
    assertThat(result).isInstanceOf(Map.class);
    Map<String, Object> map = (Map)result;
    assertThat(map.get("foo")).isEqualTo("bar");
}