add tests for autocloseable