contains(entity) {
    if (!(entity instanceof AbstractEntity)) {
      throw new TypeError("The entity must be an AbstractEntity instance, " +
          `${entity} provided`)
    }
    let entityClass = entity.constructor
    validateEntityClass(entityClass)

    if (!this[PRIVATE.entities].has(entityClass)) {
      return false
    }

    let keysToEntities = this[PRIVATE.entities].get(entityClass)
    let keyPath = this[PRIVATE.entityKeyPaths].get(entityClass.objectStore)
    let primaryKey = getPrimaryKey(entity, keyPath)
    let serializedKey = serializeKey(primaryKey)
    if (!keysToEntities.has(serializedKey)) {
      return false
    }

    return keysToEntities.get(serializedKey).entity === entity
  }
/**
   * Checks whether the provided entity is an entity managed by this entity
   * manager.
   *
   * @param {AbstractEntity} entity The entity.
   * @return {boolean} {@code true} if the provided entity is managed by this
   *         entity manager.
   */
Checks whether the provided entity is an entity managed by this entity
manager.

@param {AbstractEntity} entity The entity.
@return {boolean}  true if the provided entity is managed by this
entity manager.
Checks whether the provided entity is an entity managed by this entity manager . @param { AbstractEntity } entity The entity . @return { boolean } true if the provided entity is managed by this entity manager .
contains(entity) {
    if (!(entity instanceof AbstractEntity)) {
      throw new TypeError("The entity must be an AbstractEntity instance, " +
          `${entity} provided`)
    }
    let entityClass = entity.constructor
    validateEntityClass(entityClass)
    if (!this[PRIVATE.entities].has(entityClass)) {
      return false
    }
    let keysToEntities = this[PRIVATE.entities].get(entityClass)
    let keyPath = this[PRIVATE.entityKeyPaths].get(entityClass.objectStore)
    let primaryKey = getPrimaryKey(entity, keyPath)
    let serializedKey = serializeKey(primaryKey)
    if (!keysToEntities.has(serializedKey)) {
      return false
    }
    return keysToEntities.get(serializedKey).entity === entity
  }
contains ( entity ) { if ( ! ( entity instanceof AbstractEntity ) ) { throw new TypeError ( "The entity must be an AbstractEntity instance, " + ` ${ entity } ` ) } let entityClass = entity . constructor validateEntityClass ( entityClass ) if ( ! this [ PRIVATE . entities ] . has ( entityClass ) ) { return false } let keysToEntities = this [ PRIVATE . entities ] . get ( entityClass ) let keyPath = this [ PRIVATE . entityKeyPaths ] . get ( entityClass . objectStore ) let primaryKey = getPrimaryKey ( entity , keyPath ) let serializedKey = serializeKey ( primaryKey ) if ( ! keysToEntities . has ( serializedKey ) ) { return false } return keysToEntities . get ( serializedKey ) . entity === entity }
Checks whether the provided entity is an entity managed by this entity
 manager.
Checks whether the provided entity is an entity managed by this entity manager .