### Question:
ConflictDetectionImpl implements ConflictDetection { @Override public boolean detectConflict(SimpleObject currentObject, SimpleObject newObject) { boolean conflictDetect = false; if (currentObject != null && newObject != null) { String currentHashCode = SyncHashcodeUtils.getHashcode(currentObject); String newHashCode = SyncHashcodeUtils.getHashcode(newObject); String objectUuid = currentObject.get(UUID_KEY); ParentObjectHashcode previousHashCode = parentObjectHashcodeService.getByObjectUuid(objectUuid); if (previousHashCode != null && (!previousHashCode.getHashcode().equalsIgnoreCase(newHashCode) || !previousHashCode.getHashcode().equalsIgnoreCase(currentHashCode))) { conflictDetect = true; } } return conflictDetect; }  @Override boolean detectConflict(SimpleObject currentObject, SimpleObject newObject);  }### Answer:
@Test public void detectConflict_shouldReturnFalseIfParentHashcodeNotExist() { SimpleObject currentObj = SimpleObjectMother.createInstance(INVALID_UUID, INVALID_HASHCODE_VALUE); SimpleObject newObj = SimpleObjectMother.createInstance(INVALID_UUID, INVALID_HASHCODE_VALUE); Assert.assertFalse(conflictDetection.detectConflict(currentObj, newObj)); }
@Test public void detectConflict_shouldReturnFalseIfObjectsHaveNotChanged() { SimpleObject currentObj = SimpleObjectMother.createInstance(VALID_UUID, VALID_HASHCODE_VALUE); SimpleObject newObj = SimpleObjectMother.createInstance(VALID_UUID, VALID_HASHCODE_VALUE); Assert.assertFalse(conflictDetection.detectConflict(currentObj, newObj)); }
@Test public void detectConflict_shouldReturnTrueIfCurrentObjectChanged() { SimpleObject currentObj = SimpleObjectMother.createInstance(VALID_UUID, INVALID_HASHCODE_VALUE); SimpleObject newObj = SimpleObjectMother.createInstance(VALID_UUID, VALID_HASHCODE_VALUE); Assert.assertTrue(conflictDetection.detectConflict(currentObj, newObj)); }
@Test public void detectConflict_shouldReturnTrueIfNewObjectChanged() { SimpleObject currentObj = SimpleObjectMother.createInstance(VALID_UUID, VALID_HASHCODE_VALUE); SimpleObject newObj = SimpleObjectMother.createInstance(VALID_UUID, INVALID_HASHCODE_VALUE); Assert.assertTrue(conflictDetection.detectConflict(currentObj, newObj)); }