Implement method called for tdd-style by test case.
Error out earlier; use try-with-resource to ensure close.