refine the UT.
Change how null is compared
Refine the code.
Fix the issues in JIRA build
Improve the implementation.
merge from hbase-11339-core.