@Test
public void withComparison() throws IOException {

    writeToDslFile("for (l in network.lines) {",
            "    if (l.terminal1.voltageLevel.nominalV >= 380) {",
            "        contingency(l.id) { equipments l.id }",
            "    }",
            "}");
    List<Contingency> contingencies = new GroovyDslContingenciesProvider(dslFile)
            .getContingencies(network);
    assertEquals(2, contingencies.size());
    assertEquals(Sets.newHashSet("NHV1_NHV2_1", "NHV1_NHV2_2"), getContingenciesNames(contingencies));
    writeToDslFile("for (l in network.lines) {",
            "    if (l.terminal1.voltageLevel.nominalV >= 500) {",
            "        contingency(l.id) { equipments l.id }",
            "    }",
            "}");
    contingencies = new GroovyDslContingenciesProvider(dslFile)
            .getContingencies(network);
    assertTrue(contingencies.isEmpty());
}