Autoclosable method reference trick in Java 8 Posted on June 3, 2014 by flamingpenguin Autoclosable trick in Java 8 final Foo foo = new SomeFoo(); try (final AutoCloseable ignored = foo::close) { foo.doFoo(); }final Foo foo = new SomeFoo(); try (final AutoCloseable ignored = foo::close) { foo.doFoo(); }