@Test
void parseDoubleCast() {

    Term term = SUT.parse(IOUtils.toInputStream("CAST(CAST(parameter,S7ParameterUserData).items(hurz)[0],S7ParameterUserDataItemCPUFunctions).cpuFunctionType", Charset.defaultCharset()));
    assertVariableLiteral(
        term,
        "CAST",
        outerCast -> {
            assertThat(outerCast, hasSize(2));
            assertVariableLiteral(
                outerCast.get(0),
                "CAST",
                innerCast -> {
                    assertThat(innerCast, hasSize(2));
                    assertVariableLiteral(
                        innerCast.get(0),
                        "parameter"
                    );
                    assertVariableLiteral(
                        innerCast.get(1),
                        "S7ParameterUserData"
                    );
                },
                items -> {
                    assertVariableLiteral(
                        items,
                        "items",
                        hurzes -> {
                            assertThat(hurzes, hasSize(1));
                            assertVariableLiteral(
                                hurzes.get(0),
                                "hurz"
                            );
                        },
                        null,
                        0
                    );
                });
            assertVariableLiteral(
                outerCast.get(1),
                "S7ParameterUserDataItemCPUFunctions"
            );
        },
        variableLiteral -> {
            assertVariableLiteral(
                variableLiteral,
                "cpuFunctionType"
            );
        }
    );
}