Refactor: added automated test for first case (lines 6-8)