### Question:
ALSUtils { public static float[] computeUpdatedXu(Solver solver, double value, float[] Xu, float[] Yi, boolean implicit) { if (Yi == null) { return null; } boolean noXu = Xu == null; double Qui = noXu ? 0.0 : VectorMath.dot(Xu, Yi); double targetQui = computeTargetQui(implicit, value, noXu ? 0.5 : Qui); if (Double.isNaN(targetQui)) { return null; } double dQui = targetQui - Qui; double[] dQuiYi = new double[Yi.length]; for (int i = 0; i < dQuiYi.length; i++) { dQuiYi[i] = Yi[i] * dQui; } double[] dXu = solver.solveDToD(dQuiYi); float[] newXu = noXu ? new float[dXu.length] : Xu.clone(); for (int i = 0; i < newXu.length; i++) { newXu[i] += dXu[i]; } return newXu; } private  ALSUtils(); static double computeTargetQui(boolean implicit, double value, double currentValue); static float[] computeUpdatedXu(Solver solver,
                                         double value,
                                         float[] Xu,
                                         float[] Yi,
                                         boolean implicit);  }### Answer:
@Test public void testComputeUpdatedXu() { Collection<float[]> rows = Arrays.asList(new float[][]{ {1.0f, 2.0f}, {3.0f, 0.0f}, {0.0f, 1.0f}, }); Solver solver = LinearSystemSolver.getSolver(VectorMath.transposeTimesSelf(rows)); assertNull(ALSUtils.computeUpdatedXu(solver, 1.0, null, null, true)); assertArrayEquals(new float[] { 0.13043478f, 0.097826086f }, ALSUtils.computeUpdatedXu(solver, 1.0, null, new float[] { 2.0f, 1.0f }, true)); assertArrayEquals(new float[] { 0.11594203f, 0.08695652f }, ALSUtils.computeUpdatedXu(solver, 0.5, null, new float[] { 2.0f, 1.0f }, true)); assertArrayEquals(new float[] { 0.16086957f, 0.14565217f }, ALSUtils.computeUpdatedXu(solver, 1.0, new float[] { 0.1f, 0.1f }, new float[] { 2.0f, 1.0f }, true)); }