Merge try-resources blocks in example