@Test
public void validationTest() {

    Network network = EurostagTutorialExample1Factory.create();
    Contingency generatorContingency = new Contingency("GEN contingency", new GeneratorContingency("GEN"));
    Contingency generatorInvalidContingency = new Contingency("GEN invalid contingency", new GeneratorContingency("GE"));
    Contingency lineContingency = new Contingency("NHV1_NHV2_1 contingency", new BranchContingency("NHV1_NHV2_1", "VLHV1"));
    Contingency lineInvalidContingency = new Contingency("NHV1_NHV2_1 invalid contingency", new BranchContingency("NHV1_NHV2_1", "VLHV"));
    List<Contingency> validContingencies = Contingency.checkValidity(Arrays.asList(generatorContingency, generatorInvalidContingency,
            lineContingency, lineInvalidContingency), network);
    assertEquals(Arrays.asList("GEN contingency", "NHV1_NHV2_1 contingency"),
            validContingencies.stream().map(Contingency::getId).collect(Collectors.toList()));
}