code: public static boolean isSingletonEntity(EntityDataModel entityDataModel, Object entity) throws ODataEdmException {
          // Get the entity type
          EntityType entityType = getAndCheckEntityType(entityDataModel, entity.getClass());
          boolean isSingletonEntity = false;
  
          for (Singleton singleton : entityDataModel.getEntityContainer().getSingletons()) {
              if (singleton.getTypeName().equals(entityType.getFullyQualifiedName())) {
                  isSingletonEntity = true;
                  break;
              }
          }
  
          return isSingletonEntity;
      }
docs: Check if the given entity is a Singleton entity.
  
  @param entityDataModel The Entity Data Model.
  @param entity          The given entity.
  @return true if singleton, false if not
  @throws ODataEdmException if unable to determine if entity is singleton