code: public static double[] asDoubleArray(Collection collection) {
          double[] result = new double[collection.size()];
          int i = 0;
          for (Object c : collection) {
              result[i++] = asDouble(c);
          }
          return result;
      }
docs: Make collection into a double array.
  
  @param collection The value instance.
  @return The array.