public Optional<Group> takeGroup(Set<Integer> rejectedGroups) {
        synchronized (this) {
            Optional<GroupStatus> best = scheduler.takeNextGroup(rejectedGroups);

            if (best.isPresent()) {
                GroupStatus gs = best.get();
                gs.allocate();
                Group ret = gs.group;
                log.fine(() -> "Offering <" + ret + "> for query connection");
                return Optional.of(ret);
            } else {
                return Optional.empty();
            }
        }
    }
@Test
    void requireThatLoadBalancerServesSingleNodeSetups() {
        Node n1 = new Node("test", 0, "test-node1", 0);
        LoadBalancer lb = new LoadBalancer(List.of(new Group(0, List.of(n1))), LoadBalancer.Policy.ROUNDROBIN);

        Optional<Group> grp = lb.takeGroup(null);
        Group group = grp.orElseThrow(() -> {
            throw new IllegalStateException("Expected a SearchCluster.Group");
        });
        assertEquals(1, group.nodes().size());
    }