Turned a comment in response:
You can enter an instance variable of type T and call generateMatches. You cannot call generateMatches on type T.
You can, for example, insert this instance variable through the constructor and save it in a private variable:
private T instanceOfT; public Model(T instanceOfT){ this.instanceOfT= instanceOfT; }
In your getMatches method, you can do this:
return instanceOfT.generateMatches(doc);
source share