I have an anonymous class:
Object myArbitraryObject = new Object(){
};
Now I load a list of functions at runtime:
for(String methodName: methodNames){
Method arbitraryMethod = this.getClass().getMethod(methodName);
// TODO: add arbitraryMethod to arbitraryObject.
}
... and at a later stage:
Method [] allArbitMethods = myArbitraryObject.getClass().getMethods();
// invoking allMethods....
Is it possible to fille the TODO here? How / Why?