### Question:
FlexDoubleArray implements Serializable { public void set(int index, double val) throws MatricksException { int pos = Utils.myBinarySearch(indices, index, 0, used); if (pos >= 0) { data[pos] = val; } else { insert(-pos-1, index, val); } } FlexDoubleArray();  FlexDoubleArray(int size);  FlexDoubleArray(int size, int nz); int getSize(); int nnz(); double get(int index); void set(int index, double val); MatrixCursor cursor(); double dot(DenseDoubleVector v); double dot(double [] v); void add(double alpha, DenseDoubleVector v); void scale(final double alpha); void dotDiv(final double alpha, double [] x); void dotDiv(final double [] x); void add(FlexDoubleArray x); void addTo(double [] x); void add(final double alpha, FlexDoubleArray x); void add(final int index, final double val); double elementSum(); double dot(FlexDoubleArray x); void compact(); static final int FIRST_ALLOC_SIZE; }### Answer:
@Test public void testSet() throws Exception { System.out.println("set"); int size = 10; double offset = 500.0d; double val = 1.0F; FlexDoubleArray instance = new FlexDoubleArray(size, 1); for (int i=0; i<size; i++) { instance.set(i, offset+i); } for (int i=0; i<size; i++) { assertEquals((double) offset+i, instance.get(i), 10e-10); } }