Class ComputingMatcher<T,​M,​R>

  • Type Parameters:
    T - the element type
    M - the type that the MatchFunction produces Iterables of
    R - the result type
    All Implemented Interfaces:
    GenericMatcher<BoundMatch<R>>

    public class ComputingMatcher<T,​M,​R>
    extends BaseMatcher<T>
    implements GenericMatcher<BoundMatch<R>>
    This class implements a GenericMatcher which matches two sets of elements of type T to compute a result of type Iterable<BoundMatch<R>>. Individual elements are matched by means of a MatchFunction which produces an (intermediate) Iterable of type M for each pair of matching elements. In order to match this set against the other set, we need to find matching pairs of elements for each element identified by BaseMatcher.getAliases(). The intermediate iterables of type M produced by the matching function get accumulated across all such matching pairs to produce an Iterable of type R using a MatchAccumulator.