private Builder add(Dimension dimension) {
            Objects.requireNonNull(dimension, "A dimension cannot be null");
            if (dimensions.containsKey(dimension.name()))
                throw new IllegalArgumentException("Could not add dimension " + dimension + " as this dimension " +
                                                   "is already present");
            dimensions.put(dimension.name(), dimension);
            return this;
        }
Adds a new dimension to this

@throws IllegalArgumentException if the dimension is already present
vespajlib/src/main/java/com/yahoo/tensor/TensorType.java