I added this if condition for unit Testing.In unit test i am creating individual buttons without parent.