protected List<Predicate> getPredicates(int expectedSize) {
        List<List<Predicate>> localPredicates = new ArrayList<>(predicates);
        List<Predicate> finalPredicates = new ArrayList<>();

        if (expectedSize > localPredicates.size() && repeatedPredicates.size() != 0)
            logger.warn("The endpoint uri {} has more messages expected than provided predicates; subsequent messages " +
                    "will be accepted without any validation", endpointUri);

        for (List<Predicate> localPredicate : localPredicates) {
            List<Predicate> orderedPredicates = new ArrayList<>(localPredicate);
            orderedPredicates.addAll(0, repeatedPredicates);
            finalPredicates.add(new MultiPredicate(orderedPredicates));
        }

        while (finalPredicates.size() < expectedSize) {
            finalPredicates.add(new MultiPredicate(repeatedPredicates));
        }

        return finalPredicates;
    }
protected List < Predicate > getPredicates ( int expectedSize ) { List < List < Predicate > > localPredicates = new ArrayList < > ( predicates ) ; List < Predicate > finalPredicates = new ArrayList < > ( ) ; if ( expectedSize > localPredicates . size ( ) && repeatedPredicates . size ( ) != 0 ) logger . warn ( "The endpoint uri {} has more messages expected than provided predicates; subsequent messages " + "will be accepted without any validation" , endpointUri ) ; for ( List < Predicate > localPredicate : localPredicates ) { List < Predicate > orderedPredicates = new ArrayList < > ( localPredicate ) ; orderedPredicates . addAll ( 0 , repeatedPredicates ) ; finalPredicates . add ( new MultiPredicate ( orderedPredicates ) ) ; } while ( finalPredicates . size ( ) < expectedSize ) { finalPredicates . add ( new MultiPredicate ( repeatedPredicates ) ) ; } return finalPredicates ; }
@param expectedSize The number of predicates that we expect to exist, and the collection will be padded to this size
@return A list of predicates that will be used to validate each exchange; note that a Predicate is returned
that effectively wraps all of the predicates provided to the builder (including repeated predicates).
Repeated predicates are evaluated first.