protected void configureServices(final T builder) {
        final Set<String> serviceNames = new LinkedHashSet<>();

        for (final GrpcServiceDefinition service : this.serviceList) {
            final String serviceName = service.getDefinition().getServiceDescriptor().getName();
            if (!serviceNames.add(serviceName)) {
                throw new IllegalStateException("Found duplicate service implementation: " + serviceName);
            }
            log.info("Registered gRPC service: " + serviceName + ", bean: " + service.getBeanName() + ", class: "
                    + service.getBeanClazz().getName());
            builder.addService(service.getDefinition());
        }
    }
@Test
    void testConfigureServices() {
        final GrpcServerProperties properties = new GrpcServerProperties();
        properties.setReflectionServiceEnabled(false);

        final NettyGrpcServerFactory serverFactory = new NettyGrpcServerFactory(properties, emptyList());

        serverFactory.addService(new GrpcServiceDefinition("test1", ProtoReflectionService.class,
                ProtoReflectionService.newInstance().bindService()));
        serverFactory.addService(new GrpcServiceDefinition("test2", ProtoReflectionService.class,
                ProtoReflectionService.newInstance().bindService()));

        final NettyServerBuilder serverBuilder = serverFactory.newServerBuilder();

        assertEquals("Found duplicate service implementation: " + ServerReflectionGrpc.SERVICE_NAME,
                assertThrows(IllegalStateException.class, () -> serverFactory.configureServices(serverBuilder))
                        .getMessage());
    }