for (int i=0; i<data.length; i++)
M.set(data[i][0], data[i][1], data[i][2]);
IDoubleIterator it = M.nonzeroIterator();
IDoubleElement de = null;
for (int i=0; i<data.length; i++)
{
Assert.assertEquals(it.hasNext(), true);
de = it.next();
Assert.assertEquals(de.row(), data[i][0]);
Assert.assertEquals(de.column(), data[i][1]);
Assert.assertEquals((int)de.get(), data[i][2]);
}
Assert.assertEquals(it.hasNext(), false);
}