### Question:
FunctionFactory extends CloningFactory<Function.Element> { public Set<String> availableOperators() { Set<String> operators = new HashSet<String>(this.getObjects().keySet()); Iterator<String> it = operators.iterator(); while (it.hasNext()) { String key = it.next(); if (!getObject(key).isOperator()) { it.remove(); } } return operators; } FunctionFactory(); Set<String> availableOperators(); Set<String> availableFunctions(); @Override FunctionFactory clone();  }### Answer:
@Test public void testOperatorsCanBeCalled() throws Exception { FuzzyLite.setLogging(true); FunctionFactory ff = FactoryManager.instance().function(); double x = 0.5, y = 1.0; List<String> operators = new ArrayList<String>(ff.availableOperators()); Collections.sort(operators); for (String function : operators) { Function.Element element = ff.getObject(function); Object result; if (element.getArity() == 1) { result = element.getMethod().invoke(Op.class, x); FuzzyLite.logger().log(Level.INFO, "{0}(x={1})={2}", new Object[]{function, x, result}); } else if (element.getArity() == 2) { result = element.getMethod().invoke(Op.class, x, y); FuzzyLite.logger().log(Level.INFO, "{0}(x={1}, y={2})={3}", new Object[]{function, x, y, result}); } else { throw new RuntimeException("Only unary and binary methods are allowed"); } } }