add unit test to verify cache mechanism
update junit test