code: @SuppressWarnings("unchecked")
      public static <T> T createObject(String className, ClassLoader classLoader,
              Class<T> clazzToCast) throws InstantiationException, IllegalAccessException,
              IllegalArgumentException, InvocationTargetException, NoSuchMethodException,
              SecurityException, ClassNotFoundException {
          Class<?> clazz = classLoader != null ? Class.forName(className, false, classLoader)
                  : Class.forName(className);
          Constructor<?> constructor = clazz.getDeclaredConstructor();
          constructor.setAccessible(true);
          Object result = constructor.newInstance();
          return result != null && clazz.isAssignableFrom(result.getClass()) ? (T) result : null;
      }
docs: Create a new object.
  
  @param className
  @param classLoader
  @param clazzToCast
  @return
  @throws InstantiationException
  @throws IllegalAccessException
  @throws IllegalArgumentException
  @throws InvocationTargetException
  @throws NoSuchMethodException
  @throws SecurityException
  @throws ClassNotFoundException