public String getServiceUUID(Connection connection, String serviceEntityId, int consumingServiceIdx) {
        if (connection == null || serviceEntityId == null)
            return null;

        EntityDescriptor serviceEntityDescriptor = resolveEntityDescriptorFromMetadata(connection, serviceEntityId);

        if (serviceEntityDescriptor == null || serviceEntityDescriptor.getRoleDescriptors() == null) {
            return null;
        }

        List<XMLObject> list = serviceEntityDescriptor.getRoleDescriptors().get(0).getOrderedChildren();

        if (list == null) {
            return null;
        }

        Optional<XMLObject> xmlObject = list
            .stream()
            .filter(obj -> obj instanceof AttributeConsumingService && ((AttributeConsumingService) obj).getIndex() == consumingServiceIdx)
            .findFirst();

        if (xmlObject.isEmpty()) {
            return null;
        }

        AttributeConsumingService attributeConsumingService = (AttributeConsumingService) xmlObject.get();
        Optional<RequestedAttribute> requestedAttribute = attributeConsumingService.getRequestedAttributes()
            .stream()
            .filter(o -> o.getName().equals(SAML_SERVICE_UUID_NAME))
            .findFirst();

        return requestedAttribute.isEmpty() ? null : ((XSAny) requestedAttribute.get().getAttributeValues().get(0)).getTextContent();
    }
@Test
    void getServiceUUID() throws InitializationException {
        setupParserPool();

        String result = metadataRetrieverServiceMock.getServiceUUID(newConnection(SAML_COMBICONNECT, true, true, true), newMetadataRequest().getServiceEntityId(), 0);

        assertEquals("SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS", result);
    }