From Java Reflection, you can use method invocation to call the method identified by methodName on it without knowing the class of the object:
java.lang.reflect.Method method;
try {
method = obj.getClass().getMethod(methodName, param1.class, param2.class, ..);
} catch (SecurityException e) { ... }
catch (NoSuchMethodException e) { ... }
The parameters recognize the very specific method we need (if there are many overloaded available, if the method has no arguments, only give methodName).
To invoke that method, use:
try {
method.invoke(obj, arg1, arg2,...);
} catch (IllegalArgumentException e) { ... }
catch (IllegalAccessException e) { ... }
catch (InvocationTargetException e) { ... }
In case if there aren't any arguments in .invoke, then exclude it.