[JAVA-7] Use try-with-resource feature.