You can use the cast method, which has a class object:
Class clazz = obj.getClass(); clazz.cast(obj);
Another option: if you have access to someHandlingMethod , you can add a parameter of type Class and pass obj.getClass() .
public void someHandlingMethod(...., Class clazz); public void someHandlingMethod(...., AnotherClass clazz);
You do not need to use this option. This will simply allow you to call proofreading with overload.
source share