getMatchingBehaviorDefiningInvocation
public BehaviorDefiningInvocation getMatchingBehaviorDefiningInvocation(ProxyInvocation proxyInvocation)
First we find all behavior defining invocations that have matching argument matchers and take the one with the highest
matching score (identity match scores higher than an equals match). If there are 2 invocations with the same score,
we take the invocation with the lowest nr of not-null (default) arguments. If both have the same nr of not-null
arguments, the first one is returned. E.g.
myMethod(null, null);
myMethod("a", null);
The second one will be returned if the given proxy invocation has the value "a" as first argument.
- Parameters:
proxyInvocation - The actual invocation to match with, not null
- Returns:
- The behavior defining invocation that matches best with the actual invocation, null if none found