Simple demonstration of matrix manipulations in Java