@Override
    public List<ServiceDefinition> apply(Exchange exchange, List<ServiceDefinition> services) {
        for (int i = 0; i < delegatesSize; i++) {
            services = delegates.get(i).apply(exchange, services);
        }

        return services;
    }
@Test
    public void testMultiServiceFilter() throws Exception {
        CombinedServiceCallServiceFilterConfiguration conf = new CombinedServiceCallServiceFilterConfiguration()
                .healthy()
                .custom((exchange, services) -> services.stream().filter(s -> s.getPort() < 2000).toList());

        Exchange exchange = new DefaultExchange(context);
        List<ServiceDefinition> services = conf.newInstance(context).apply(exchange, Arrays.asList(
                new DefaultServiceDefinition("no-name", "127.0.0.1", 1000),
                new DefaultServiceDefinition("no-name", "127.0.0.1", 1001, new DefaultServiceHealth(false)),
                new DefaultServiceDefinition("no-name", "127.0.0.1", 1002, new DefaultServiceHealth(true)),
                new DefaultServiceDefinition("no-name", "127.0.0.1", 2001, new DefaultServiceHealth(true)),
                new DefaultServiceDefinition("no-name", "127.0.0.1", 2001, new DefaultServiceHealth(false))));

        assertEquals(2, services.size());
        assertFalse(services.stream().anyMatch(s -> !s.getHealth().isHealthy()));
        assertFalse(services.stream().anyMatch(s -> s.getPort() > 2000));
        assertTrue(services.stream().anyMatch(s -> s.getPort() == 1000));
        assertTrue(services.stream().anyMatch(s -> s.getPort() == 1002));
    }