void () { doTest( """ class Test{ void test(){ AC ac = ACHolder.makeAc(); useAc(new ACHolder(ac)); } void useAc(ACHolder holder) {} } class ACHolder { private final AC ac; public static AC makeAc() { return null;} ACHolder(AC ac) {this.ac = ac;} } class AC implements AutoCloseable { @Override public void close(){} }"""); }