Sonar Violations and Formatting

This isn't a safe implementation of equals. Prone to class cast exceptions and null pointer exceptions.