static Set<String> findVariables(List<Statement> statements, EncodedValueLookup lookup) {
        List<List<Statement>> groups = CustomModelParser.splitIntoGroup(statements);
        Set<String> variables = new LinkedHashSet<>();
        for (List<Statement> group : groups) findVariablesForGroup(variables, group, lookup);
        return variables;
    }
@Test
    public void runVariables() {
        DecimalEncodedValue prio1 = new DecimalEncodedValueImpl("my_priority", 5, 1, false);
        IntEncodedValueImpl prio2 = new IntEncodedValueImpl("my_priority2", 5, -5, false, false);
        EncodedValueLookup lookup = new EncodingManager.Builder().add(prio1).add(prio2).build();

        assertEquals(Set.of(), findVariables("2", lookup));
        assertEquals(Set.of("my_priority"), findVariables("2*my_priority", lookup));

        Exception ex = assertThrows(IllegalArgumentException.class, () ->  findVariables("-2*my_priority", lookup));
        assertTrue(ex.getMessage().contains("illegal expression as it can result in a negative weight"));
    }