public static DenseSparseMatrix createIdentity(int dimension) {
        SparseVector[] newValues = new SparseVector[dimension];
        for (int i = 0; i < dimension; i++) {
            newValues[i] = new SparseVector(dimension, new int[]{i}, new double[]{1.0});
        }
        return new DenseSparseMatrix(newValues);
    }
@Test
    public void testCreateIdentity() {
        DenseSparseMatrix identity = DenseSparseMatrix.createIdentity(5);
        assertMatrixEquals(new DenseMatrix(new double[][]{new double[]{1.0, 0.0, 0.0, 0.0, 0.0}, new double[]{0.0, 1.0, 0.0, 0.0, 0.0}, new double[]{0.0, 0.0, 1.0, 0.0, 0.0}, new double[]{0.0, 0.0, 0.0, 1.0, 0.0}, new double[]{0.0, 0.0, 0.0, 0.0, 1.0}}),identity);
        identity = DenseSparseMatrix.createIdentity(1);
        assertMatrixEquals(new DenseMatrix(new double[][]{new double[]{1.0}}),identity);
    }