public void onStubbingLookup(StubbingLookupEvent event) { Strictness actualStrictness = determineStrictness(event.getStubbingFound(), event.getMockSettings(), currentStrictness); if (actualStrictness != Strictness.STRICT_STUBS) { return; } if (event.getStubbingFound() == null) { //If stubbing was not found for invocation it means that either the mock invocation was not stubbed or //we have a stubbing arg mismatch. List<Invocation> argMismatchStubbings = potentialArgMismatches(event.getInvocation(), event.getAllStubbings()); if (!argMismatchStubbings.isEmpty()) { mismatchesReported = true; Reporter.potentialStubbingProblem(event.getInvocation(), argMismatchStubbings); } } else { //when strict stubs are in use, every time a stub is realized in the code it is implicitly marked as verified //this way, the users don't have to repeat themselves to verify stubbed invocations (DRY) event.getInvocation().markVerified(); } }