Add Matrix.java (with trailing whitespace removed)