I might have not understood generics complety, what is the right way to handle this kind of problem:
How can I get rid of the cast (T)? This way, I could just use Object and not use Generics at all, but I want to make sure to a return an object of the same type as the parameter. Yes, I'm aware of the generics tutorial but I didn't find an answer there. Thanks for suggestions!