The following interface defines two overloaded methods. Both take one parameter where one is of type "java.util.Collection", the other one of "java.util.Set":
Furthermore a decorator is defined:
A client injects an instance of MyService and invokes "run" using a Set of integer values:
It can be observed that the method " void run(Collection<String> values)" is invoked on the decorator - which is wrong. Changing the order of the method declarations in the interface MyService "solves" the problem.