void () { doTest(""" import java.io.*; class X implements AutoCloseable { @Override public void close() {} private static void example() { consume(() -> new X()); } \s interface Consumer { X use();} private static native X getX(); private static native void consume(Consumer x); }"""); }