}
return mock;
}
private static <T> Class<?> createReplicaType(Class<T> type, boolean isStatic, ConstructorArgs constructorArgs) {
ClassReplicaCreator classReplicaCreator = new ClassReplicaCreator();
Class<?> replicaType = null;
if (isStatic || constructorArgs == null) {
replicaType = classReplicaCreator.createClassReplica(type);
} else {
try {
replicaType = classReplicaCreator.createInstanceReplica(constructorArgs.getConstructor().newInstance(
constructorArgs.getInitArgs()));
} catch (RuntimeException e) {
throw e;
} catch (InvocationTargetException e) {
Throwable targetException = e.getTargetException();