Improved formatting and added test case to EntityComparator.