Add unit tests

Change-Id: I49c0cecb3da644797649f419eeb3be6d8c47a2f9