@@ -0,0 +1,1484 @@
+package com.yahoo.vespa.tenant.cd.metrics;%0A%0Aimport java.util.HashSet;%0Aimport java.util.List;%0Aimport java.util.Map;%0Aimport java.util.Set;%0Aimport java.util.stream.IntStream;%0A%0Aimport static java.util.stream.Collectors.toUnmodifiableMap;%0A%0A/**%0A * Used to easily generate points for a pre-defined space.%0A *%0A * @author jonmv%0A */%0Apublic class Space %7B%0A%0A    private final List%3CString%3E dimensions;%0A%0A    private Space(List%3CString%3E dimensions) %7B%0A        this.dimensions = dimensions;%0A    %7D%0A%0A    /** Creates a new space with the given named dimensions, in order. */%0A    public static Space of(List%3CString%3E dimensions) %7B%0A        if (Set.copyOf(dimensions).size() != dimensions.size())%0A            throw new IllegalArgumentException(%22Duplicated dimension names in '%22 + dimensions + %22'.%22);%0A%0A        return new Space(List.copyOf(dimensions));%0A    %7D%0A%0A    /** Returns a point in this space, with the given values along each dimensions, in order. */%0A    public Map%3CString, ?%3E at(List%3C?%3E values) %7B%0A        if (dimensions.size() != values.size())%0A            throw new IllegalArgumentException(%22This space has %22 + dimensions.size() + %22 dimensions, but %22 + values.size() + %22 were given.%22);%0A%0A        return IntStream.range(0, dimensions.size()).boxed().collect(toUnmodifiableMap(dimensions::get, values::get));%0A    %7D%0A%0A    /** Returns a point in this space, with the given values along each dimensions, in order. */%0A    public Map%3CString, ?%3E at(Object... values) %7B%0A        return at(List.of(values));%0A    %7D%0A%0A%7D%0A

Add Space for convenience construction of points