Refactoring some unit tests. Removed remaining SONAR fixes.