code: public static EntitySet getEntitySetByEntity(EntityDataModel entityDataModel, Object entity)
              throws ODataEdmException {
          return getEntitySetByEntityTypeName(entityDataModel,
                  getAndCheckEntityType(entityDataModel, entity.getClass()).getFullyQualifiedName());
      }
docs: Get the Entity Set of a given entity through the Entity Data Model.
  
  @param entityDataModel The Entity Data Model.
  @param entity          The given entity.
  @return The Entity Set.
  @throws ODataEdmException If unable to get entity set