public void costBetweenDescendingDirection() throws IllegalArgumentException, RepositoryException {
OrderedPropertyIndex index = new OrderedPropertyIndex();
NodeBuilder builder = InitialContent.INITIAL_CONTENT.builder();
defineDescendingIndex(builder);
NodeState root = builder.getNodeState();
Filter filter = createNiceMock(Filter.class);
Filter.PropertyRestriction restriction = new Filter.PropertyRestriction();
restriction.first = PropertyValues.newDate("2013-01-01");
restriction.last = PropertyValues.newDate("2013-01-02");
restriction.firstIncluding = true;
restriction.lastIncluding = true;
restriction.propertyName = ORDERED_PROPERTY;
expect(filter.getPropertyRestrictions()).andReturn(ImmutableList.of(restriction))
.anyTimes();
expect(filter.containsNativeConstraint()).andReturn(false).anyTimes();
replay(filter);
assertFalse("In descending order we're expeting to serve this kind of queries",
Double.POSITIVE_INFINITY == index.getCost(filter, root));