}
// grab max of values lower than the target
FilterFactory ff = getDataStore().getFilterFactory();
Query qBelow = new Query(query);
Filter lessFilter = ff.lessOrEqual(ff.property(attribute), ff.literal(targetValue));
qBelow.setFilter(ff.and(query.getFilter(), lessFilter));
MaxVisitor max = new MaxVisitor(attribute);
handleVisitor(qBelow, max);
Comparable maxBelow = (Comparable) max.getResult().getValue();
if(maxBelow != null && maxBelow.equals(targetValue)) {