Add tests for helper function ifAnonymous

Change-Id: Ic82316661535fafc0c236064657a3fc4d268f78d
Merge "Add tests for helper function ifAnonymous"