Fast follow-on unit tests for HashedStringCache

Unit tests for HashedStringCache that was commited in earlier CL
ag/6867725 . This is testing the various inputs and expected outputs.
Testing also revealed some vulnerability for invalid input so added
validation in the code under test.

Bug: b/129870147
Test: This is the test file
Change-Id: I7387f808df87a869f81339cd4aea99b23dfc06bd
2 files changed