}
private static <T> T doCreateMock(Class<T> type, ConstructorArgs constructorArgs, final IMocksControl control,
Method... methods) {
T mock;
MocksControl mocksControl = ((MocksControl) control);
if (constructorArgs == null) {
if (methods == null) {
mock = mocksControl.createMock(type);
} else {
mock = mocksControl.createMock(type, methods);
}
} else {
if (methods == null) {
mock = mocksControl.createMock(type, constructorArgs);
} else {
mock = mocksControl.createMock(type, constructorArgs, methods);
}
}
return mock;
}