### Question:
JBlasAlternatingLeastSquaresSolver { static DoubleMatrix createMiIi(Iterable<Vector> featureVectors, int numFeatures) { int numRatings = Iterables.size(featureVectors); DoubleMatrix MiIi = new DoubleMatrix(numFeatures, numRatings); int n = 0; for (Vector featureVector : featureVectors) { for (int m = 0; m < numFeatures; m++) { MiIi.put(m, n, featureVector.getQuick(m)); } n++; } return MiIi; } private  JBlasAlternatingLeastSquaresSolver(); static Vector solve(Iterable<Vector> featureVectors, Vector ratingVector, double lambda, int numFeatures);  }### Answer:
@Test public void createMiIi() { Vector f1 = new DenseVector(new double[] { 1, 2, 3 }); Vector f2 = new DenseVector(new double[] { 4, 5, 6 }); DoubleMatrix miIi = JBlasAlternatingLeastSquaresSolver.createMiIi(Arrays.asList(f1, f2), 3); assertEquals(1.0, miIi.get(0, 0), EPSILON); assertEquals(2.0, miIi.get(1, 0), EPSILON); assertEquals(3.0, miIi.get(2, 0), EPSILON); assertEquals(4.0, miIi.get(0, 1), EPSILON); assertEquals(5.0, miIi.get(1, 1), EPSILON); assertEquals(6.0, miIi.get(2, 1), EPSILON); }