### Question:
LinearConstraintTerm extends HyperplaneTerm { @Override public void minimize(float stepSize, float[] consensusValues) { if (!comparator.equals(FunctionComparator.EQ)) { float total = 0.0f; for (int i = 0; i < size; i++) { LocalVariable variable = variables[i]; variable.setValue(consensusValues[variable.getGlobalId()] - variable.getLagrange() / stepSize); total += coefficients[i] * variable.getValue(); } if ( (comparator.equals(FunctionComparator.LTE) && total <= constant) || (comparator.equals(FunctionComparator.GTE) && total >= constant) ) { return; } } project(stepSize, consensusValues); } protected  LinearConstraintTerm(GroundRule groundRule, Hyperplane<LocalVariable> hyperplane, FunctionComparator comparator); @Override float evaluate(); @Override float evaluate(float[] consensusValues); @Override void minimize(float stepSize, float[] consensusValues);  }### Answer:
@Test public void testMinimize() { float[] z = {0.2f, 0.5f}; float[] y = {0.0f, 0.0f}; float[] coeffs = {1.0f, 1.0f}; float constant = 1.0f; FunctionComparator comparator = FunctionComparator.LTE; float stepSize = 1.0f; float[] expected = {0.2f, 0.5f}; testProblem(z, y, coeffs, constant, comparator, stepSize, expected); z = new float[] {0.7f, 0.5f}; y = new float[] {0.0f, 0.0f}; coeffs = new float[] {1.0f, 1.0f}; constant = 1.0f; comparator = FunctionComparator.LTE; stepSize = 1.0f; expected = new float[] {0.6f, 0.4f}; testProblem(z, y, coeffs, constant, comparator, stepSize, expected); z = new float[] {0.7f, 0.5f}; y = new float[] {0.0f, 0.0f}; coeffs = new float[] {1.0f, -1.0f}; constant = 0.0f; comparator = FunctionComparator.EQ; stepSize = 1.0f; expected = new float[] {0.6f, 0.6f}; testProblem(z, y, coeffs, constant, comparator, stepSize, expected); }