I tried to solve it like this:
public Object getProxy(Class item, Class...items){
return (Object) Proxy.newProxyInstance(this.getClass().getClassLoader(), items, new ItemInvocationHandler(item));
}
but I am getting the wrong output.
Now I had a look at the "Right Solution" and I don't understand anything of it.
especially this line:
public <T extends Item> T getProxy(Class<T> type, Class<?>... additionalInterfaces) {
I don't even know what to google. I searched for Generics for dynamic proxies, generic return types and read the 4 CG articles on Generics but still... totally lost.
Should I try to dig into it or will this be explained later in the course?
Thanks in advance