itemExists = function (collection, entityName, entityRoles) {
    let matchInClosedLists = helpers.filterMatch(collection, 'name', entityName);
    if (matchInClosedLists.length !== 0) {
        // merge roles if there are any roles in the pattern entity
        if (entityRoles.length !== 0) {
            mergeRoles(matchInClosedLists[0].roles, entityRoles);
        }
        return true;
    }
    return false;
}
Helper function that returns true if the item exists. Merges roles before returning 
@param {Object} collection contents of the current collection
@param {string} entityName name of entity to look for in the current collection
@param {string []} entityRoles target entity roles collection to merge
@returns {void} nothing