code: public static <T> T instantiate(Class<T> anInterface, String className) throws CmsException {
  
          try {
              Class<?> cls = Class.forName(className, false, anInterface.getClassLoader());
              if (!anInterface.isAssignableFrom(cls)) {
                  // class was found, but does not implement the interface
                  throw new CmsIllegalArgumentException(
                      Messages.get().container(
                          Messages.ERR_INSTANTIATION_INCORRECT_TYPE_2,
                          className,
                          anInterface.getName()));
              }
  
              // we use another variable so we don't have to put the @SuppressWarnings on the method itself
              @SuppressWarnings("unchecked")
              Class<T> typedClass = (Class<T>)cls;
              return typedClass.newInstance();
          } catch (ClassNotFoundException e) {
              throw new CmsException(Messages.get().container(Messages.ERR_INSTANTIATION_FAILED_1, className), e);
          } catch (InstantiationException e) {
              throw new CmsException(Messages.get().container(Messages.ERR_INSTANTIATION_FAILED_1, className), e);
          } catch (IllegalAccessException e) {
              throw new CmsException(Messages.get().container(Messages.ERR_INSTANTIATION_FAILED_1, className), e);
          }
      }
docs: Instantiates a class given its name using its default constructor.<p>
  
  Also checks whether the class with the given name is the subclass of another class/interface.<p>
  
  
  @param <T> the type of the interface/class passed as a parameter
  
  @param anInterface the interface or class against which the class should be checked
  @param className the name of the class
  @return a new instance of the class
  
  @throws CmsException if the instantiation fails