public static Class<?> loadClass(String className) throws ClassNotFoundException {
    ClassLoader spockClassLoader = ReflectionUtil.class.getClassLoader();
    try {
      return spockClassLoader.loadClass(className);
    } catch (ClassNotFoundException outerEx) {
      ClassLoader contextClassLoader;
      try {
        //Try ContextClassLoader to better support for runtimes like OSGi
        contextClassLoader = Thread.currentThread().getContextClassLoader();
      } catch (SecurityException ex) {
        throw outerEx;
      }
      if (contextClassLoader != null && contextClassLoader != spockClassLoader) {
        return contextClassLoader.loadClass(className);
      }
      throw outerEx;
    }
  }
Loads the className in the following order:
<ul>
<li>Spock {@link ClassLoader}</li>
<li>{@code Thread.currentThread().getContextClassLoader()}</li>
</ul>

@param className the class to load
@return the loaded class
@throws ClassNotFoundException if the class could not be found
spock-core/src/main/java/org/spockframework/util/ReflectionUtil.java