//mocks for evalFunction()
Sequence mockContextSequence = EasyMock.createMock(Sequence.class);
Item mockContextItem = EasyMock.createMock(Item.class);
Sequence[] mockSeq = { Sequence.EMPTY_SEQUENCE };
int nextExpressionId = 1234;
SequenceType[] mockArgumentTypes = { new SequenceType(Type.NODE, Cardinality.ZERO) };
//mock for functionDef
FunctionSignature mockFunctionSignature = EasyMock.createMock(FunctionSignature.class);
SequenceType mockReturnType = EasyMock.createMock(SequenceType.class);
LocalVariable mockMark = EasyMock.createMock(LocalVariable.class);
Expression mockExpression = EasyMock.createMock(Expression.class);
//expectations for UserDefinedFunction constructor
expect(mockContext.nextExpressionId()).andReturn(nextExpressionId++);
expect(mockExpression.simplify()).andReturn(mockExpression);
//expectations for FunctionCall constructor
expect(mockContext.nextExpressionId()).andReturn(nextExpressionId++);
//expectations for FunctionCall.setFunction
expect(mockFunctionSignature.getReturnType()).andReturn(mockReturnType);
expect(mockReturnType.getCardinality()).andReturn(Cardinality.ZERO_OR_MORE);
expect(mockReturnType.getPrimaryType()).andReturn(Type.NODE).times(4);
expect(mockContext.nextExpressionId()).andReturn(nextExpressionId++);
//expectations for functionCall.evalFunction
expect(mockContext.isProfilingEnabled()).andReturn(false);
expect(mockContext.getPDP()).andReturn(null);