added function for providing a custom compare method
added tests
refactored function; prevent duplication
code cleanup
changed order of parameters
Merge pull request #326 from sulu-cmf/feature/compareEntityData

[FEATURE] added function for providing a custom compare method