public Object intercept(Object proxy, Method method, Object[] args, MethodProxy methodProxy) throws Throwable {
if (mockitoStubber.hasAnswersForStubbing()) {
//stubbing voids with stubVoid() or doAnswer() style
Invocation invocation = new Invocation(proxy, method, args, mockingProgress.nextSequenceNumber());
InvocationMatcher invocationMatcher = matchersBinder.bindMatchers(invocation);
mockitoStubber.setMethodForStubbing(invocationMatcher);
return null;
}
VerificationMode verificationMode = mockingProgress.pullVerificationMode();
mockingProgress.validateState();
Invocation invocation = new Invocation(proxy, method, args, mockingProgress.nextSequenceNumber());
InvocationMatcher invocationMatcher = matchersBinder.bindMatchers(invocation);
if (verificationMode != null) {
VerificationDataImpl data = new VerificationDataImpl(registeredInvocations.getAll(), invocationMatcher);
verificationMode.verify(data);
return null;
}
mockitoStubber.setInvocationForPotentialStubbing(invocationMatcher);
registeredInvocations.add(invocationMatcher.getInvocation());
mockingProgress.reportOngoingStubbing(new OngoingStubbingImpl());
Answer<?> answer = mockitoStubber.findAnswerFor(invocation);
if (answer != null) {