Thanks Jochen. Not sure if I fully understood, are you suggesting that the current LRU cache which is keyed only on receiver could be effectively extended with a more complex key based on arguments and other guards? That seems reasonable to me.
One other thought, would using MethodHandle.invoke instead of invokeExact be useful for my second example? I think the sameClasses guard is maybe too strict here, both arguments would be accepted to a MethodHandle.invoke() which is expecting type List. (I don't know this area well at all so take those with a big pinch of salt.) Anyway I'll be interested to follow any developments if you do decide to make some changes. Oli Amazon Development Centre (London) Ltd. Registered in England and Wales with registration number 04543232 with its registered office at 1 Principal Place, Worship Street, London EC2A 2FA, United Kingdom.