Fix regression of challenge 4
Add tests for challenge 6
Minor changes
Use Java bitCount