Added EntityComparatorTest.

And fixed a failing test.