Fixed wrong logic in ObjectUtils and wrote its unit test code.