private static IllegalArgumentException formatException(String spec, Optional<String> errorDetail) {
        throw new IllegalArgumentException("A tensor type spec must be on the form " +
                                           "tensor[<valuetype>]?(dimensionidentifier[{}|[length]*), but was '" + spec + "'. " +
                                           errorDetail.map(s -> s + ". ").orElse("") +
                                           "Examples: tensor(x[3]), tensor<float>(name{}, x[10])");
    }
@param dimensionOrder if not null, this will be populated with the dimension names in the order they are written
vespajlib/src/main/java/com/yahoo/tensor/TensorTypeParser.java