Sonar Violations and Formatting

Use hamcrest matchers