Refine the code by Anoop's comment. And refine the ut.
Merge branch 'hbase-11339-core' of https://github.com/JingchengDu/hbase into hbase-11339-core