proof of concept: another method of determining try-with-resources