Added unittest to sonar. Fixed some bugs about Duplications