List<Integer> allocatePorts(NetworkPortRequestor service, int wantedPort) {
        PortAllocBridge allocator = new PortAllocBridge(this, service);
        service.allocatePorts(wantedPort, allocator);
        return allocator.result();
    }
@Test
    void allocating_overlapping_ports_throws_exception() {
        assertThrows(RuntimeException.class, () -> {
            HostPorts host = new HostPorts("myhostname");
            MockRoot root = new MockRoot();
            TestService service2 = new TestService(root, 2);
            TestService service1 = new TestService(root, 1);

            host.allocatePorts(service2, HostPorts.BASE_PORT);
            host.allocatePorts(service1, HostPorts.BASE_PORT + 1);
        });
    }