Object () { Long size = null; try (MyAutoCloseable autoCloseable = new MyAutoCloseable()) { size = autoCloseable.count(); return size; } catch (MyAutoCloseable.MyClosingException e) { return size; } }