There is an alternative to creating a Command interface and then creating classes that implement that interface when you wish to use the Command pattern in Java. The alternative is to use the java.lang.reflect.Method class, each instance of which corresponds to a method in a class. If this approach is used, then the ExtendedCollection interface can be redefined to include the following declaration:
public void map(Object o, Method m)
This version of map repeatedly invokes the given method m on the given object o, using elements of the ExtendedCollection as the parameter to the method. It only works if the method takes exactly one parameter. If the method is static, then o is ignored and so it can be null.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.