import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;

interface MyFunctionalInterface {
    Object invokeMethodReference(Object... args) throws Throwable;
}

public class Test4 {
    public static void main(String argv[]) throws Throwable {
        MethodHandles.Lookup lookup = MethodHandles.lookup();
        MethodType mt = MethodType.methodType(String.class);
        MethodHandle ms = lookup.findVirtual(Integer.class, "toString", mt);

        System.out.println(ms.invoke(new Integer(23)));
        MyFunctionalInterface instance = ms::invoke;
        Object result = instance.invokeMethodReference(new Integer(23));
    }
}


