static MinMax findMinMax(MinMax minMax, List<Statement> statements, EncodedValueLookup lookup) {
        List<List<Statement>> groups = CustomModelParser.splitIntoGroup(statements);
        for (List<Statement> group : groups) findMinMaxForGroup(minMax, group, lookup);
        return minMax;
    }
@Test
    public void testFindMaxPriority() {
        List<Statement> statements = new ArrayList<>();
        statements.add(If("true", MULTIPLY, "2"));
        assertEquals(2, findMinMax(new MinMax(0, 1), statements, lookup).max);

        List<Statement> statements2 = new ArrayList<>();
        statements2.add(If("true", MULTIPLY, "0.5"));
        assertEquals(0.5, findMinMax(new MinMax(0, 1), statements2, lookup).max);

        List<Statement> statements3 = new ArrayList<>();
        statements3.add(If("road_class == MOTORWAY", MULTIPLY, "0.5"));
        statements3.add(Else(MULTIPLY, "-0.5"));
        IllegalArgumentException m = assertThrows(IllegalArgumentException.class, () -> findMinMax(new MinMax(1, 1), statements3, lookup));
        assertTrue(m.getMessage().startsWith("statement resulted in negative value"));
    }