LCH-7038: Checking if entity is valid before creating dependency wrapper.
LCH-7038: Added tests.
LCH-7038: Added logging.
LCH-7038: Checking if remote entity exists locally.
LCH-7038: Added check for invalid entities in getEntitiesByRemoteIdAndHash.
Related to LCH-7053