SONAR-5341 Add some unit test and complete Javadoc