void () { doTest(""" import java.io.*; class X implements Closeable { @Override public void close() throws IOException {} private static void example(Object o) throws IOException { new <warning descr="'X' used without 'try'-with-resources statement">X</warning>().doX(); } private X doX() { return this; } }"""); }