private static Object doMethodCall(Object object, String methodName, Object[] args, Class<?>[] sig,
String returnTypeAsString) throws Throwable {
if (!shouldMockMethod(methodName, sig)) {
return PROCEED;
}
MockInvocation mockInvocation = new MockInvocation(object, methodName, sig);
MethodInvocationControl methodInvocationControl = mockInvocation.getMethodInvocationControl();
Object returnValue = null;
if (isEqualsMethod(mockInvocation) && !isStaticMethod(mockInvocation)) {
returnValue = tryHandleEqualsMethod(mockInvocation);
}
if (returnValue != null) {
return returnValue;
}
return doMethodCall(object, args, returnTypeAsString, mockInvocation, methodInvocationControl);
}