Make sure that badges array does not have gaps

PS #1: addded tests

Change-Id: I77894da8f87a5fa34707163494c011014c66ed62
Merge "Make sure that badges array does not have gaps"