int length = 1 + rnd.nextInt(4);
Summand[] summands = new Summand[length];
List<Variable> vars = new ArrayList<Variable>();
for (int k = 0; k < length; k++) {
summands[k].setCoeff(0.5 - rnd.nextDouble());
Variable v;
do {
v = (Variable)l.getVariables().toArray()[rnd.nextInt(l.getVariables().size())];
} while (vars.contains(v));
summands[k].setVar(v);
vars.add(v);