With this pr, map.clear operation clears client nearcache. fixes #2363

I see code duplication; if you want to populate near cache, pull out the code in a method so that it can be shared between multiple tests.