@Override
 protected void loadAllFunctionImports() {
   final List<? extends CommonFunctionImport> localFunctionImports =
       xmlEntityContainer.getFunctionImports();
   if (localFunctionImports != null) {
     for (CommonFunctionImport functionImport : localFunctionImports) {
       EdmFunctionImport edmFunctionImport;
       if (functionImport instanceof org.apache.olingo.client.api.edm.xml.v4.FunctionImport) {
         edmFunctionImport =
             new EdmFunctionImportImpl(
                 edm,
                 this,
                 functionImport.getName(),
                 (org.apache.olingo.client.api.edm.xml.v4.FunctionImport) functionImport);
       } else {
         edmFunctionImport =
             new EdmFunctionImportProxy(
                 edm,
                 this,
                 functionImport.getName(),
                 (org.apache.olingo.client.api.edm.xml.v3.FunctionImport) functionImport);
       }
       functionImports.put(edmFunctionImport.getName(), edmFunctionImport);
     }
   }
 }
 private void writeFunctionImports(final JsonGenerator gen, final EdmEntityContainer container)
     throws IOException {
   for (EdmFunctionImport edmFunctionImport : container.getFunctionImports()) {
     if (edmFunctionImport.isIncludeInServiceDocument()) {
       writeElement(
           gen, FUNCTION_IMPORT, edmFunctionImport.getName(), edmFunctionImport.getName());
     }
   }
 }
 @Override
 public String getSegmentValue() {
   if (functionImport != null) {
     return functionImport.getName();
   } else if (function != null) {
     return function.getName();
   }
   return "";
 }
 @Override
 public String toString() {
   if (functionImport != null) {
     return functionImport.getName();
   } else if (function != null) {
     return function.getName();
   }
   return "";
 }
  private void appendFunctionImports(
      final XMLStreamWriter writer,
      final List<EdmFunctionImport> functionImports,
      final String containerNamespace)
      throws XMLStreamException {
    for (EdmFunctionImport functionImport : functionImports) {
      writer.writeStartElement(XML_FUNCTION_IMPORT);
      writer.writeAttribute(XML_NAME, functionImport.getName());

      String functionFQNString;
      FullQualifiedName functionFqn = functionImport.getFunctionFqn();
      if (namespaceToAlias.get(functionFqn.getNamespace()) != null) {
        functionFQNString =
            namespaceToAlias.get(functionFqn.getNamespace()) + "." + functionFqn.getName();
      } else {
        functionFQNString = functionFqn.getFullQualifiedNameAsString();
      }
      writer.writeAttribute(XML_FUNCTION, functionFQNString);

      EdmEntitySet returnedEntitySet = functionImport.getReturnedEntitySet();
      if (returnedEntitySet != null) {
        writer.writeAttribute(
            XML_ENTITY_SET, containerNamespace + "." + returnedEntitySet.getName());
      }
      // Default is false and we do not write the default
      if (functionImport.isIncludeInServiceDocument()) {
        writer.writeAttribute(
            XML_INCLUDE_IN_SERVICE_DOCUMENT, "" + functionImport.isIncludeInServiceDocument());
      }
      writer.writeEndElement();
    }
  }