If you have an anonymous class like
Predicate isEmpty = new Predicate() {
public boolean test(String t) {
return t.isEmpt
After all, I found a way of getting hold of a lambda expression's class file that is rather reliable (but of course still relies on implementation details.) For an experimental implementation, I am now using a Java agent which allows for the retransformation of classes but which is itself implemented as a no-op, I am only interested in the binary array that is handed as an argument.
After getting hold of an Instrumentation instance via the registered Java agent, one registers a ClassFileTransformer which is then notified over the binary representation once one retransforms lambdaInstance.getClass(). This is of course a rather hacky solution and might break once the internal implementation of lambdas is changed in the future.
Unfortunately, I did not find any documentation on how an agent is supposed to behave with class retransformation of a lambda expression's synthetic class on a standards-compatible JVM.