@Test
    public void requireThatStatementsBeforeOneThatIgnoresInputAreRemoved() {
        checkStatementThatIgnoresInput(new InputExpression("foo"));
        checkStatementThatIgnoresInput(new NowExpression());
        checkStatementThatIgnoresInput(new ConstantExpression(new IntegerFieldValue(42)));
        checkStatementThatIgnoresInput(new HostNameExpression());
        checkStatementThatIgnoresInput(new RandomExpression(42));
        checkStatementThatIgnoresInput(new ArithmeticExpression(
                new NowExpression(), ArithmeticExpression.Operator.ADD, new NowExpression()));
        checkStatementThatIgnoresInput(new CatExpression(new NowExpression(), new NowExpression()));
        checkStatementThatIgnoresInput(new ParenthesisExpression(new NowExpression()));
        assertOptimized("input foo | (trim | now)", "(now)");
        assertOptimized("input foo | get_var bar", "get_var bar");
        assertOptimized("1 | index foo | now | 0", "1 | index foo | 0");
    }
@author <a href="mailto:magnarn@yahoo-inc.com">Magnar Nedland</a>
indexinglanguage/src/test/java/com/yahoo/vespa/indexinglanguage/ExpressionOptimizerTestCase.java