class GroupTree implements Iterable<TDigest.Group> {

    public TDigest.Group floor(TDigest.Group base) {
        if (size == 0) {
            return null;
        } else {
            if (size == 1) {
                return base.compareTo(leaf) >= 0 ? leaf : null;
            } else {
                if (base.compareTo(leaf) < 0) {
                    return left.floor(base);
                } else {
                    TDigest.Group floor = right.floor(base);
                    if (floor == null) {
                        floor = left.last();
                    }
                    return floor;
                }
            }
        }
    }

    public  GroupTree();
    public  GroupTree(TDigest.Group leaf);
    public  GroupTree(GroupTree left, GroupTree right);

}