code: public static byte[] byteArrayCopyOf(CollectionNumber coll) {
          byte[] data = new byte[coll.size()];
          IteratorNumber iter = coll.iterator();
          int index = 0;
          while (iter.hasNext()) {
              data[index] = iter.nextByte();
              index++;
          }
          return data;
      }
docs: Copies the content of the collection to an array.
  
  @param coll the collection
  @return the array