I have a ProxyGenerator which looks like the one at bottom. My problem now is that I don't know which type this is:
Consumer<...?????> myConsumer = (proxy, method, args) -> method.invoke(realSubject, args);
Consumer is wrong, is there a simple way of determine of which type the Lambda expression is (e.g. with Eclipse)?
public class ProxyGenerator {
public static <P> P makeProxy(Class<P> subject, P realSubject) {
Consumer<Subject_A> myConsumer = (proxy, method, args) -> method.invoke(realSubject, args);
final Object proxyInstance = Proxy.newProxyInstance(subject.getClassLoader(), new Class<?>[] { subject },
(proxy, method, args) -> method.invoke(realSubject, args));
return subject.cast(proxyInstance);
}
}
myConsumerisn't used anywhere in your example.