Add Matices in ArrayList <Matrix>?

So I have the following method I have written:

Quote:

public Matrix add(Matrix other){

if (other.matrix[0].length!=matrix[0].length||other.matrix.length!=matrix.length){

return null;

}

Matrix ret = new Matrix(matrix.length, matrix[0].length);

for(int i=0;i<matrix.length;i++){ //rows

for(int j=0; j<matrix[0].length;j++){ //columns

ret.set(i,j, matrix[i][j] + other.matrix[i][j]);

}

}

return ret;

}

Basically, this takes a matrix entered by the user (other) and adds in to another matrix they already entered (matrix).

However, I have to write another method called sum in which I have to add an ArrayList filled with objects of Matrix type. How can I use this method to do that? The method I need to write adds all the matrices in the ArrayList and puts them into a new array. Assume that all matrices in the ArrayList are of the same dimensions.

Thanks