" return the empty sequence",
Sequence.EMPTY,
intersectFunction.invoke(expressionContextMock, new Value[] {
Sequence.EMPTY, Sequence.EMPTY
}));
final Sequence firstSequence =
expressionContextMock.getFactory().createSequence(
new Item[] {
expressionContextMock.getFactory()
.createStringValue("value0"),
expressionContextMock.getFactory()
.createStringValue("value1"),
expressionContextMock.getFactory()
.createStringValue("value2"),
expressionContextMock.getFactory()
.createBooleanValue(true)});
final Sequence secondSequence =
expressionContextMock.getFactory().createSequence(
new Item[] {
expressionContextMock.getFactory()
.createStringValue("value2"),
expressionContextMock.getFactory()
.createStringValue("value2"),
expressionContextMock.getFactory()
.createStringValue("value3"),
expressionContextMock.getFactory()
.createBooleanValue(false),
expressionContextMock.getFactory()
.createBooleanValue(true)});
final Sequence result = (Sequence) intersectFunction.invoke(
expressionContextMock, new Value[] {firstSequence,
secondSequence});
assertEquals("number of elements in returned sequence is incorrect",
2, result.getLength());
assertEquals("incorrect element in returned sequence",
"value2", result.getItem(1).stringValue().asJavaString());
assertEquals("incorrect element in returned sequence",
"true", result.getItem(2).stringValue().asJavaString());
}