Make code more strightforward

  so PMD can understand better
Add overrides
Compare objects with equals
Add overrides
Compare objects using equals