code: public static SamlMetadataUIInfo locateMetadataUserInterfaceForEntityId(final EntityDescriptor entityDescriptor, final String entityId,
                                                                              final RegisteredService registeredService, final HttpServletRequest requestContext) {
          val mdui = new SamlMetadataUIInfo(registeredService, requestContext.getLocale().getLanguage());
          if (entityDescriptor == null) {
              LOGGER.trace("Entity descriptor not found for [{}]", entityId);
              return mdui;
          }
          val spssoDescriptor = getSPSsoDescriptor(entityDescriptor);
          if (spssoDescriptor == null) {
              LOGGER.trace("SP SSO descriptor not found for [{}]", entityId);
              return mdui;
          }
          val extensions = spssoDescriptor.getExtensions();
          if (extensions == null) {
              LOGGER.trace("No extensions in the SP SSO descriptor are found for [{}]", UIInfo.DEFAULT_ELEMENT_NAME.getNamespaceURI());
              return mdui;
          }
          val spExtensions = extensions.getUnknownXMLObjects(UIInfo.DEFAULT_ELEMENT_NAME);
          if (spExtensions.isEmpty()) {
              LOGGER.trace("No extensions in the SP SSO descriptor are located for [{}]", UIInfo.DEFAULT_ELEMENT_NAME.getNamespaceURI());
              return mdui;
          }
          spExtensions.stream().filter(UIInfo.class::isInstance).forEach(obj -> {
              val uiInfo = (UIInfo) obj;
              LOGGER.trace("Found MDUI info for [{}]", entityId);
              mdui.setUiInfo(uiInfo);
          });
          return mdui;
      }
docs: Locate mdui for entity id simple metadata ui info.
  
  @param entityDescriptor  the entity descriptor
  @param entityId          the entity id
  @param registeredService the registered service
  @param requestContext    the request context
  @return the simple metadata ui info