public static boolean isDeterministic(Expression expression)
    {
        requireNonNull(expression, "expression is null");

        AtomicBoolean deterministic = new AtomicBoolean(true);
        new Visitor().process(expression, deterministic);
        return deterministic.get();
    }
@Test
    public void testSanity()
    {
        assertFalse(ExpressionDeterminismEvaluator.isDeterministic(function("rand")));
        assertFalse(ExpressionDeterminismEvaluator.isDeterministic(function("random")));
        assertFalse(ExpressionDeterminismEvaluator.isDeterministic(function("shuffle")));
        assertTrue(ExpressionDeterminismEvaluator.isDeterministic(function("abs", input("symbol"))));
        assertFalse(ExpressionDeterminismEvaluator.isDeterministic(function("abs", function("rand"))));
        assertTrue(ExpressionDeterminismEvaluator.isDeterministic(function("abs", function("abs", input("symbol")))));
    }