code: @SuppressWarnings("unchecked")
    private MessageTransformer setMessageTransformer(EmailConfiguration config,
        EmailSetup newSetup) throws ClassNotFoundException,
        InstantiationException, IllegalAccessException {
      MessageTransformer transformer;
      Class<?> mtcCandidate = Class.forName(config.getMessageTransformer());
      
      if(MessageTransformer.class.isAssignableFrom(mtcCandidate)){     
        transformer = ((Class<MessageTransformer>)mtcCandidate).newInstance();
        newSetup.messageTransformer = transformer;
      } else {
        throw new IllegalArgumentException(config.getMessageTransformer() + " is not an instance of " + MessageTransformer.class.getName());
      }
      return transformer;
    }
docs: Instantiates and sets up a new {@link MessageTransformer} instance and assigns a reference to it in the new setup object passed in.
  
  @param config The configuration to pull the class name for the class to instantiate.
  @param newSetup The {@link EmailSetup} reference to assign the new instance to.
  @return The new instance of the {@link MessageTransformer} class requested.
  @throws ClassNotFoundException
  @throws InstantiationException
  @throws IllegalAccessException
  @throws IllegalArgumentException