code: public static EntitySet getEntitySetByEntityTypeName(EntityDataModel entityDataModel, String entityTypeName)
              throws ODataEdmException {
          for (EntitySet entitySet : entityDataModel.getEntityContainer().getEntitySets()) {
              if (entitySet.getTypeName().equals(entityTypeName)) {
                  return entitySet;
              }
          }
          throw new ODataSystemException("Entity set not found in the entity data model for type: " + entityTypeName);
      }
docs: Get the Entity Set for a given Entity Type name through the Entity Data Model.
  
  @param entityDataModel The Entity Data Model.
  @param entityTypeName  The Entity Type name.
  @return The Entity Set.
  @throws ODataEdmException if unable to get entity set in entity data model