public static ContainerEndpoint endpointFromSlime(Inspector inspector) {
        String clusterId = inspector.field(clusterIdField).asString();
        String scope = inspector.field(scopeField).asString();
        Inspector namesInspector = inspector.field(namesField);
        OptionalInt weight = SlimeUtils.optionalInteger(inspector.field(weightField));
        // assign default routingmethod. Remove when 7.507 is latest version
        // Cannot be used before all endpoints are assigned explicit routing method (from controller)
        ApplicationClusterEndpoint.RoutingMethod routingMethod = SlimeUtils.optionalString(inspector.field(routingMethodField))
                                                                           .map(ContainerEndpointSerializer::routingMethodFrom)
                                                                           .orElse(ApplicationClusterEndpoint.RoutingMethod.sharedLayer4);
        ApplicationClusterEndpoint.AuthMethod authMethod = SlimeUtils.optionalString(inspector.field(authMethodField))
                                                                     .map(ContainerEndpointSerializer::authMethodFrom)
                                                                     .orElse(ApplicationClusterEndpoint.AuthMethod.mtls);
        if (clusterId.isEmpty()) {
            throw new IllegalStateException("'clusterId' missing on serialized ContainerEndpoint");
        }
        if (scope.isEmpty()) {
            throw new IllegalStateException("'scope' missing on serialized ContainerEndpoint");
        }
        if (!namesInspector.valid()) {
            throw new IllegalStateException("'names' missing on serialized ContainerEndpoint");
        }

        List<String> names = new ArrayList<>();

        namesInspector.traverse((ArrayTraverser) (idx, nameInspector) -> {
            final var containerName = nameInspector.asString();
            names.add(containerName);
        });

        return new ContainerEndpoint(clusterId, scopeFrom(scope), names, weight, routingMethod, authMethod);
    }
@Test
    public void readSingleEndpoint() {
        final var slime = new Slime();
        final var entry = slime.setObject();

        entry.setString("clusterId", "foobar");
        entry.setString("scope", "application");
        final var entryNames = entry.setArray("names");
        entryNames.addString("a");
        entryNames.addString("b");

        final var endpoint = ContainerEndpointSerializer.endpointFromSlime(slime.get());
        assertEquals("foobar", endpoint.clusterId());
        assertEquals(ApplicationClusterEndpoint.Scope.application, endpoint.scope());
        assertEquals(List.of("a", "b"), endpoint.names());
    }