Helper for object implementing AutoCloseable.
Whether the scope is closed.
Throws IllegalStateException if closed is true.
true
Returns block's result or throws IllegalStateException if closed is true.
Notifies about scope closing.