private static <T> boolean isEquiDimensional(T[][] matrix) {
		if (matrix.length == 0) {
			return true;
		}
			
		if (matrix.length == 1) {
			if (matrix[0].length != matrix.length) {
				return false;
			}
		}

      for (T[] row : matrix) {
         if (row.length != matrix.length) {
            return false;
         }
      }
		
		return true;
	}