ResourceHolder () { ResourceHolder holder = new ResourceHolder(); cleaner.register(holder, <warning descr="Runnable passed to Cleaner.register() captures 'holder' reference">holder</warning>::free); return holder; }