This topic discusses Lambda expressions, a Java language feature introduced in Java 8 that enables a functional style of programming in Java.

About Java Lambda

Here's a short example:

LambdaMethodInterface i = (acc, x) -> acc + x;
CODE

In the JVM, this creates an anonymous instance of the associated FunctionalInterface, as shown below:

package jdk8;
 
@java.lang.FunctionalInterface
interface LambdaMethodInterface
{
    int sum(int acc, int x);
}
CODE

Instrumenting Java Lambda

To instrument lambda instances, create a POJO business transaction match rule for the LambdaMethodInterface, for example:

This sample rule matches classes that implement the interface name jdk8.LambdaMethodInterface