code: public static <V extends NumberVector> V randomVector(NumberVector.Factory<V> factory, int dim) {
      return randomVector(factory, dim, new Random());
    }
docs: Produce a new vector based on random numbers in [0:1].
  
  @param factory Vector factory
  @param dim desired dimensionality
  @param <V> vector type
  @return new instance