The trick here is to "wrap" the constructor in its own object, and then use that object to create the class you need.
If you dont know what class you are instancing, well then you dont know if it has a constructor, thus you cant call it.
static <T> void myFunction(Provider<T> provider){
T t = provider.get();
}
interface Provider<T>{
public T get();
}
public class MyClass{
}
public static void main(String [] args){
myFunction(new Provider<MyClass>(){
public MyClass get(){
return new MyClass();
}
});
}