Resets the given mock object and turns them to a mock with default
behavior. For details, see the EasyMock documentation.

@param mock
the mock object

@return the mock object
321702
@SuppressWarnings("unchecked")
	public <X> X resetToDefault(final Object mock) {
		EasyMock.resetToDefault(mock);
		return (X) mock;
	}
164996
@Override
    public void visitMethod(Method obj) {
        stack.resetForMethodEntry(this);
        jdbcLocals.clear();

        int[] parmRegs = RegisterUtils.getParameterRegisters(obj);
        Type[] argTypes = obj.getArgumentTypes();

        for (int t = 0; t < argTypes.length; t++) {
            String sig = argTypes[t].getSignature();
            if (isJDBCClass(sig)) {
                jdbcLocals.put(Integer.valueOf(parmRegs[t]),
                        Integer.valueOf(RegisterUtils.getLocalVariableEndRange(obj.getLocalVariableTable(), parmRegs[t], 0)));
            }
        }
    }
840617
@SafeVarargs
    public final Builder retryOn(Class<? extends Exception>... exceptions) {
      for (Class<? extends Exception> exception : exceptions) {
        retriableExceptions.add(checkNotNull(exception));
      }
      return this;
    }
363018
@Override
    public void beforeEach(final ExtensionContext context) {
        Set<Object> testInstances = new LinkedHashSet<>();
        testInstances.add(context.getRequiredTestInstance());

        this.collectParentTestInstances(context, testInstances);

        Strictness actualStrictness = this.retrieveAnnotationFromTestClasses(context)
            .map(MockitoSettings::strictness)
            .orElse(strictness);

        MockitoSession session = Mockito.mockitoSession()
            .initMocks(testInstances.toArray())
            .strictness(actualStrictness)
            .logger(new MockitoSessionLoggerAdapter(Plugins.getMockitoLogger()))
            .startMocking();

        context.getStore(MOCKITO).put(SESSION, session);
    }
284939
@Override
    public void refresh() {
        String url = mockupTypes.getUrl(mockupType);
        
        if (mockupId == null || url == null) {
            iframe.setSrc(null);
            return;
        }
        
        iframe.setSrc(String.format(url, mockupId, System.currentTimeMillis()));
    }
717465
public static <T extends Query<?, R>, R extends Object> T createMock(Class<T> type) {
    return Mockito.mock(type, createAnswer(type));
  }
408960
public static synchronized <T> T createMock(Class<T> type, Method... methods) {
        return doMock(type, false, new DefaultMockStrategy(), null, methods);
    }
111324
public RxLoader1<A, T> restart(A arg1) {
        restart(observableFunc.call(arg1));
        return this;
    }
1200828
public boolean reset() {
        try (Locker.Lock lock = _locker.lock()) {
            switch (_state) {
                case IDLE:
                    return true;

                case SUCCEEDED:
                case FAILED:
                    _iterate = false;
                    _state = State.IDLE;
                    return true;

                default:
                    return false;
            }
        }
    }
758832
function mock (mock) {
  if (mock === false) {
    mocking = false
  } else {
    mocking = true
    cli.stderr = ''
    cli.stdout = ''
  }
}
546857
public MockServerClient reset() {
        MockServerEventBus.getInstance().publish(EventType.RESET);
        sendRequest(request().withMethod("PUT").withPath(calculatePath("reset")));
        return clientClass.cast(this);
    }
323483
public void reset() {
    isEmpty_ = false;
    theta_ = Long.MAX_VALUE;
    sketch_ = null;
    isFirstCall_ = true;
  }
72582
@Override
    public void interceptCleanupSpecMethod(IMethodInvocation invocation) throws Throwable {
        Class<?> specClass = invocation.getSpec().getReflection();
        log.fine("afterClass " + specClass.getName());
        getTestRunner().afterClass(specClass, new InvocationExecutor(invocation));
    }
808587
function resetIndexedDBMock () {
	mockIndexedDBItems.length = 0;

	mockIndexedDB_openDBSuccess = false;
	mockIndexedDB_openDBFail = false;
	mockIndexedDB_openDBAbort = false;
	mockIndexedDB_openDBBlocked = false;
	mockIndexedDB_openDBUpgradeNeeded = false;

	mockIndexedDB_openCursorSuccess = false;
	mockIndexedDB_openCursorFail = false;
	mockIndexedDB_cursorReadingDone = false;

	mockIndexedDB_saveSuccess = false;
	mockIndexedDB_saveFail = false;
	mockIndexedDB_deleteSuccess = false;
	mockIndexedDB_deleteFail = false;
	mockIndexedDB_clearSuccess = false;
	mockIndexedDB_clearFail = false;
	mockIndexedDB_createStoreSuccess = false;
	mockIndexedDB_createStoreFail = false;
	mockIndexedDB_deleteDBSuccess = false;
	mockIndexedDB_deleteDBFail = false;

	mockIndexedDB_cursorResultsIndex = 0;

	mockIndexedDBTestFlags.canOpenDB = true;
	mockIndexedDBTestFlags.openDBShouldBlock = false;
	mockIndexedDBTestFlags.openDBShouldAbort = false;
  mockIndexedDBTestFlags.upgradeNeeded = false;
	mockIndexedDBTestFlags.canReadDB = true;
	mockIndexedDBTestFlags.canSave = true;
	mockIndexedDBTestFlags.canDelete = true;
  mockIndexedDBTestFlags.canClear = true;
	mockIndexedDBTestFlags.canCreateStore = true;
	mockIndexedDBTestFlags.canDeleteDB = true;

	clearTimeout(mockIndexedDB_openDBTimer);
	clearTimeout(mockIndexedDB_createObjectStoreTimer);
	clearTimeout(mockIndexedDB_cursorContinueTimer);
	clearTimeout(mockIndexedDB_storeAddTimer);
	clearTimeout(mockIndexedDB_storeDeleteTimer);
	clearTimeout(mockIndexedDB_storeClearTimer);
	clearTimeout(mockIndexedDB_storeOpenCursorTimer);
	clearTimeout(mockIndexedDB_deleteDBTimer);
}
439018
@SuppressWarnings({"CheckReturnValue", "MockitoUsage", "unchecked"})
    static void verifyInt(MockedVoidMethod method, VerificationMode mode, InOrder
            instanceInOrder) {
        if (onMethodCallDuringVerification.get() != null) {
            throw new IllegalStateException("Verification is already in progress on this "
                    + "thread.");
        }

        ArrayList<Method> verifications = new ArrayList<>();

        /* Set up callback that is triggered when the next static method is called on this thread.
         *
         * This is necessary as we don't know which class the method will be called on. Once the
         * call is intercepted this will
         *    1. Remove all matchers (e.g. eq(), any()) from the matcher stack
         *    2. Call verify on the marker for the class
         *    3. Add the markers back to the stack
         */
        onMethodCallDuringVerification.set((clazz, verifiedMethod) -> {
            // TODO: O holy reflection! Let's hope we can integrate this better.
            try {
                ArgumentMatcherStorageImpl argMatcherStorage = (ArgumentMatcherStorageImpl)
                        mockingProgress().getArgumentMatcherStorage();
                List<LocalizedMatcher> matchers;

                // Matcher are called before verify, hence remove the from the storage
                Method resetStackMethod
                        = argMatcherStorage.getClass().getDeclaredMethod("resetStack");
                resetStackMethod.setAccessible(true);

                matchers = (List<LocalizedMatcher>) resetStackMethod.invoke(argMatcherStorage);

                if (instanceInOrder == null) {
                    verify(staticMockMarker(clazz), mode);
                } else {
                    instanceInOrder.verify(staticMockMarker(clazz), mode);
                }

                // Add the matchers back after verify is called
                Field matcherStackField
                        = argMatcherStorage.getClass().getDeclaredField("matcherStack");
                matcherStackField.setAccessible(true);

                Method pushMethod = matcherStackField.getType().getDeclaredMethod("push",
                        Object.class);

                for (LocalizedMatcher matcher : matchers) {
                    pushMethod.invoke(matcherStackField.get(argMatcherStorage), matcher);
                }
            } catch (NoSuchFieldException | NoSuchMethodException | IllegalAccessException
                    | InvocationTargetException | ClassCastException e) {
                throw new Error("Reflection failed. Do you use a compatible version of "
                        + "mockito?", e);
            }

            verifications.add(verifiedMethod);
        });
        try {
            try {
                // Trigger the method call. This call will be intercepted and trigger the
                // onMethodCallDuringVerification callback.
                method.run();
            } catch (Throwable t) {
                if (t instanceof RuntimeException) {
                    throw (RuntimeException) t;
                } else if (t instanceof Error) {
                    throw (Error) t;
                }
                throw new RuntimeException(t);
            }

            if (verifications.isEmpty()) {
                // Make sure something was intercepted
                throw new IllegalArgumentException("Nothing was verified. Does the lambda call "
                        + "a static method on a 'static' mock/spy ?");
            } else if (verifications.size() > 1) {
                // A lambda might call several methods. In this case it is not clear what should
                // be verified. Hence throw an error.
                throw new IllegalArgumentException("Multiple intercepted calls on methods "
                        + verifications);
            }
        } finally {
            onMethodCallDuringVerification.remove();
        }
    }
1087749
public static MockInjectionStrategy nop() {
        return new MockInjectionStrategy() {
            protected boolean processInjection(Field field, Object fieldOwner, Set<Object> mockCandidates) {
                return false;
            }
        };
    }
692349
public static void remove(Object mock) {
		if (mock instanceof Class<?>) {
			if (newSubstitutions.containsKey(mock)) {
				newSubstitutions.remove(mock);
			}
			if (classMocks.containsKey(mock)) {
				classMocks.remove(mock);
			}
		} else if (instanceMocks.containsKey(mock)) {
			instanceMocks.remove(mock);
		}
	}