public static <T> T newInstance(Class<T> clazz, Object... args) {
    Checks.notNull(clazz, () -> "Class must not be null");
    Checks.notNull(args, () -> "Argument array must not be null");
    Checks.containsNoNullElements(args, () -> "Individual arguments must not be null");

    try {
      Class<?>[] parameterTypes = Arrays.stream(args).map(Object::getClass).toArray(Class[]::new);
      return newInstance(clazz.getDeclaredConstructor(parameterTypes), args);
    } catch (Throwable t) {
      return ExceptionUtil.sneakyThrow(ExceptionUtil.getUnderlyingCause(t));
    }
  }
Returns the class file for the given class (which has been verified to exist in the returned location),
or null if the class file could not be found (e.g. because it is contained in a Jar).
spock-core/src/main/java/org/spockframework/util/ReflectionUtil.java