### Question:
FlexDoubleArray implements Serializable { public MatrixCursor cursor() { return new FlexDoubleArrayCursor(); } 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 testCursor() throws Exception { System.out.println("cursor"); FlexDoubleArray instance = new FlexDoubleArray(10); instance.set(3, 30d); instance.set(5, 50d); MatrixCursor result = instance.cursor(); assertNotNull(result); assertTrue(result.next()); assertEquals(0, result.col()); assertEquals(3, result.row()); assertEquals(30d, result.val(), 0.000001d); assertTrue(result.next()); assertEquals(0, result.col()); assertEquals(5, result.row()); assertEquals(50d, result.val(), 0.000001d); assertFalse(result.next()); }