@Test
    public void testGeneratorWithStringInputArrayOutput() {
        Map<String, FieldGenerator> generators = Map.of("generator", new SplitterMockFieldGenerator());
        
        var expressionString = "input myText | generate | attribute myGeneratedArray";
        var input = "hello world";

        var expression = expressionFrom(generators, expressionString);
        
        SimpleTestAdapter adapter = new SimpleTestAdapter();

        var inputField = new Field("myText", DataType.STRING);
        adapter.createField(inputField);

        var outputField = new Field("myGeneratedArray",  DataType.getArray(DataType.STRING));
        adapter.createField(outputField);
        
        adapter.setValue("myText", new StringFieldValue(input));
        
        expression.setStatementOutput(new DocumentType("myDocument"), outputField);

        expression.resolve(new TypeContext(adapter));

        ExecutionContext context = new ExecutionContext(adapter);
        expression.execute(context);

        assertTrue(adapter.values.containsKey("myGeneratedArray"));
        var actual = adapter.values.get("myGeneratedArray");

        var expected = new Array<>(DataType.getArray(DataType.STRING), 
                List.of(new StringFieldValue("hello"), new StringFieldValue("world")));
        
        assertEquals(actual, expected);
    }
Tests a common use case where an array is generated from one text input.
indexinglanguage/src/test/java/com/yahoo/vespa/indexinglanguage/GenerateExpressionTestCase.java