ExpressionVisitorImpl implements ExpressionVisitor<Object> { @Override public Object visitLambdaFunctionExpression( LambdaFunctionExpression.Type type, String variable, Expression expression) throws ExpressionVisitException { if (type == LambdaFunctionExpression.Type.ANY) { return _any(expression); } throw new UnsupportedOperationException( "Unsupported type visitLambdaFunctionExpression with type " + type); } ExpressionVisitorImpl(
		Format format, Locale locale, EntityModel entityModel); @Override Filter visitBinaryExpressionOperation(
		BinaryExpression.Operation operation, Object left, Object right); @Override Object visitCollectionPropertyExpression(
			CollectionPropertyExpression collectionPropertyExpression); @Override Object visitComplexPropertyExpression(
		ComplexPropertyExpression complexPropertyExpression); @Override Object visitLambdaFunctionExpression(
			LambdaFunctionExpression.Type type, String variable,
			Expression expression); @Override EntityField visitLambdaVariableExpression(
			LambdaVariableExpression lambdaVariableExpression); @Override Object visitListExpressionOperation(
			ListExpression.Operation operation, Object left, List<Object> right); @Override Object visitLiteralExpression(LiteralExpression literalExpression); @Override Object visitMemberExpression(MemberExpression memberExpression); @Override Object visitMethodExpression(
		List<Object> expressions, MethodExpression.Type type); @Override Object visitPrimitivePropertyExpression(
		PrimitivePropertyExpression primitivePropertyExpression); @Override Filter visitUnaryExpressionOperation(
		UnaryExpression.Operation operation, Object operand);  }
@Test public void testVisitLambdaFunctionExpressionAny() throws ExpressionVisitException { LambdaFunctionExpression lambdaFunctionExpression = new LambdaFunctionExpressionImpl( LambdaFunctionExpression.Type.ANY, "k", new BinaryExpressionImpl( new MemberExpressionImpl( new LambdaVariableExpressionImpl("k")), BinaryExpression.Operation.EQ, new LiteralExpressionImpl( "keyword1", LiteralExpression.Type.STRING))); Map<String, EntityField> entityFieldsMap = _entityModel.getEntityFieldsMap(); CollectionEntityField collectionEntityField = (CollectionEntityField)entityFieldsMap.get("keywords"); ExpressionVisitorImpl expressionVisitorImpl = new ExpressionVisitorImpl( new SimpleDateFormat("yyyyMMddHHmmss"), LocaleUtil.getDefault(), new EntityModel() { @Override public Map<String, EntityField> getEntityFieldsMap() { return Collections.singletonMap( "k", collectionEntityField.getEntityField()); } @Override public String getName() { return collectionEntityField.getName(); } }); TermFilter termFilter = (TermFilter)expressionVisitorImpl.visitLambdaFunctionExpression( lambdaFunctionExpression.getType(), lambdaFunctionExpression.getVariableName(), lambdaFunctionExpression.getExpression()); Assert.assertNotNull(termFilter); Assert.assertEquals("keywords.raw", termFilter.getField()); Assert.assertEquals("keyword1", termFilter.getValue()); }