QueryObjectModelFactoryFacade implements QueryObjectModelFactory { @Override public And and(final Constraint constraint1, final Constraint constraint2) throws RepositoryException { return delegate.and(constraint1, constraint2); } QueryObjectModelFactoryFacade(@NotNull final QueryObjectModelFactory delegate, @NotNull final SessionFacade<S> session); @Override QueryObjectModel createQuery(final Source source,
                                        final Constraint constraint,
                                        final Ordering[] orderings,
                                        final Column[] columns); @Override Selector selector(final String nodeTypeName, final String selectorName); @Override Join join(final Source left, final Source right, final String joinType, final JoinCondition joinCondition); @Override EquiJoinCondition equiJoinCondition(final String selector1Name,
                                               final String property1Name,
                                               final String selector2Name,
                                               final String property2Name); @Override SameNodeJoinCondition sameNodeJoinCondition(final String selector1Name, final String selector2Name, final String selector2Path); @Override ChildNodeJoinCondition childNodeJoinCondition(final String childSelectorName, final String parentSelectorName); @Override DescendantNodeJoinCondition descendantNodeJoinCondition(final String descendantSelectorName, final String ancestorSelectorName); @Override And and(final Constraint constraint1, final Constraint constraint2); @Override Or or(final Constraint constraint1, final Constraint constraint2); @Override Not not(final Constraint constraint); @Override Comparison comparison(final DynamicOperand operand1, final String operator, final StaticOperand operand2); @Override PropertyExistence propertyExistence(final String selectorName, final String propertyName); @Override FullTextSearch fullTextSearch(final String selectorName, final String propertyName, final StaticOperand fullTextSearchExpression); @Override SameNode sameNode(final String selectorName, final String path); @Override ChildNode childNode(final String selectorName, final String path); @Override DescendantNode descendantNode(final String selectorName, final String path); @Override PropertyValue propertyValue(final String selectorName, final String propertyName); @Override Length length(final PropertyValue propertyValue); @Override NodeName nodeName(final String selectorName); @Override NodeLocalName nodeLocalName(final String selectorName); @Override FullTextSearchScore fullTextSearchScore(final String selectorName); @Override LowerCase lowerCase(final DynamicOperand operand); @Override UpperCase upperCase(final DynamicOperand operand); @Override BindVariableValue bindVariable(final String bindVariableName); @Override Literal literal(final Value literalValue); @Override Ordering ascending(final DynamicOperand operand); @Override Ordering descending(final DynamicOperand operand); @Override Column column(final String selectorName, final String propertyName, final String columnName);  }
@Test public void testAnd() throws RepositoryException { QueryObjectModelFactory delegate = mock(QueryObjectModelFactory.class); QueryObjectModelFactoryFacade<Session> facade = getFacade(delegate); final And value = mock(And.class); final Constraint arg1 = mock(Constraint.class); final Constraint arg2 = mock(Constraint.class); when(delegate.and(arg1, arg2)).thenReturn(value); assertSame("is same value", value, facade.and(arg1, arg2)); }