recursive toString for lists and tests to validate it