I don\'t believe I am implementing the factory pattern correctly because the Application class\' createDocument method accepts any class type, not just
Application
createDocument
Where is the restriction to Document type in the factory ? Try
public T createDocument(Class documentClass) throws InstantiationException, IllegalAccessException { return documentClass.newInstance(); };