code: public final static <T> T createInstance(String className, Class<T> expectedType, boolean useCache) throws Err.Compilation, Err.UnloadableClass {
          try {
              Object o = createInstance(getCompiledClass(className, useCache)); // a check to see if the class exists
              T instance = expectedType.cast(o); // a check to see if the class is actually a correct subclass
              return instance ;
          } catch (Err.Compilation | Err.UnloadableClass e) {
              throw e;
          } catch (ClassCastException e) {
              //from cast()
              throw new Err.UnloadableClass("Class: " + className + " is not the expected type, are you sure it extends " + expectedType.getName() + "?");
          } catch (Exception e) {
              throw new Err.UnloadableClass(e);
          }
      }
docs: Loads and instantiates the class into the stated <code>expectedType</code>.
  
  @param className Full name of the class including package name
  @param expectedType The type to convert the class into
  @param useCache flag to specify whether to cache the class or not
  @return The newly instantiated class
  @throws CompilationException If the class could not be successfully compiled
  @throws ClassLoadException