Clean up: Moved trailing comments to a new line, change .size to isEmpty, removed unused imports, moved braces to type instead of the variable, move string literal to the left when comparing

GCP-9879

Reviewer: Aldrin Batac
Add more unit test scenarios for check variables retrieval and saving

GCP-9879

Reviewer: Aldrin Batac