@Override
  protected void loadAllSingletons() {
    if (!(xmlEntityContainer instanceof org.apache.olingo.client.api.edm.xml.v4.EntityContainer)) {
      throw new UnsupportedInV3Exception();
    }

    final List<Singleton> localSingletons =
        ((org.apache.olingo.client.api.edm.xml.v4.EntityContainer) xmlEntityContainer)
            .getSingletons();
    if (localSingletons != null) {
      for (Singleton singleton : localSingletons) {
        singletons.put(
            singleton.getName(),
            new EdmSingletonImpl(
                edm,
                this,
                singleton.getName(),
                new EdmTypeInfo.Builder()
                    .setTypeExpression(singleton.getEntityType())
                    .setDefaultNamespace(entityContainerName.getNamespace())
                    .build()
                    .getFullQualifiedName(),
                singleton));
      }
    }
  }
  @Override
  protected EdmSingleton createSingleton(final String singletonName) {
    if (!(xmlEntityContainer instanceof org.apache.olingo.client.api.edm.xml.v4.EntityContainer)) {
      throw new UnsupportedInV3Exception();
    }

    final Singleton singleton =
        ((org.apache.olingo.client.api.edm.xml.v4.EntityContainer) xmlEntityContainer)
            .getSingleton(singletonName);
    if (singleton == null) {
      throw new EdmException(
          "Singleton named '" + singletonName + "' not found in " + entityContainerName);
    }
    return new EdmSingletonImpl(
        edm,
        this,
        singletonName,
        new EdmTypeInfo.Builder()
            .setTypeExpression(singleton.getEntityType())
            .setDefaultNamespace(entityContainerName.getNamespace())
            .build()
            .getFullQualifiedName(),
        singleton);
  }