code: public Primitive anyWithArityLessThan(int maxArity, RandEngine randEngine)
     {
        List<Primitive> ops = new ArrayList<>();
        for (int i = 0; i < entities.size(); ++i)
        {
           Primitive op1 = entities.get(i);
           if (op1.arity() < maxArity)
           {
              ops.add(op1);
           }
        }
        if (ops.isEmpty()) return null;
        return ops.get(randEngine.nextInt(ops.size()));
     }
docs: / <returns></returns>