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

    Object result = new JavaScript("test","x = [ 'foo', 'bar' ]").exec(scope);
    assertThat(result).isInstanceOf(List.class);
    List<Object> list = (List)result;
    assertThat(list.size()).isEqualTo(2);
    assertThat(list.get(0)).isEqualTo("foo");
    assertThat(list.get(1)).isEqualTo("bar");
}