void () { doTest(""" import java.io.*; class X implements AutoCloseable { @Override public void close() {} private static void example() { consume(() -> new <warning descr="'X' used without 'try'-with-resources statement">X</warning>()); } \s interface Runnable { void run();} private static native X getX(); private static native void consume(Runnable x); }"""); }