Ok :) 
The idea of this example is to show that you could just try all the possible implementations. I don't know if there's a preferred / common way of discriminating implementation, so I just came up with a random example. Apparently Java libs tends to add a class name field so it sounds like a good scenario to implement.