code: public static EntitySet getAndCheckEntitySet(EntityDataModel entityDataModel, String entitySetName) {
          EntitySet entitySet = entityDataModel.getEntityContainer().getEntitySet(entitySetName);
          if (entitySet == null) {
              throw new ODataSystemException("Entity set not found in the entity data model: " + entitySetName);
          }
          return entitySet;
      }
docs: Gets the entity set with the specified name, throws an exception if no entity set with the specified name exists.
  
  @param entityDataModel The entity data model.
  @param entitySetName   The name of the entity set.
  @return The entity set.
  @throws ODataSystemException If the entity data model does not contain an entity set with the specified name.