@Test public void validationTestForShunt() { Network network = HvdcTestNetwork.createLcc(); Contingency shuntCompensatorContingency = new Contingency("Shunt contingency", new ShuntCompensatorContingency("C1_Filter1")); Contingency shuntCompensatorInvalidContingency = new Contingency("Shunt invalid contingency", new ShuntCompensatorContingency("C_Filter")); List<Contingency> validContingencies = Contingency.checkValidity(Arrays.asList(shuntCompensatorContingency, shuntCompensatorInvalidContingency), network); assertEquals(Arrays.asList("Shunt contingency"), validContingencies.stream().map(Contingency::getId).collect(Collectors.toList())); }
public static List<Contingency> checkValidity(List<Contingency> contingencies, Network network) { Objects.requireNonNull(contingencies); Objects.requireNonNull(network); return contingencies.stream() .filter(c -> isValid(c, network)) .collect(Collectors.toList()); }
Contingency extends AbstractExtendable<Contingency> { public static List<Contingency> checkValidity(List<Contingency> contingencies, Network network) { Objects.requireNonNull(contingencies); Objects.requireNonNull(network); return contingencies.stream() .filter(c -> isValid(c, network)) .collect(Collectors.toList()); } }
Contingency extends AbstractExtendable<Contingency> { public static List<Contingency> checkValidity(List<Contingency> contingencies, Network network) { Objects.requireNonNull(contingencies); Objects.requireNonNull(network); return contingencies.stream() .filter(c -> isValid(c, network)) .collect(Collectors.toList()); } Contingency(String id, ContingencyElement... elements);  Contingency(String id, List<ContingencyElement> elements); }
Contingency extends AbstractExtendable<Contingency> { public static List<Contingency> checkValidity(List<Contingency> contingencies, Network network) { Objects.requireNonNull(contingencies); Objects.requireNonNull(network); return contingencies.stream() .filter(c -> isValid(c, network)) .collect(Collectors.toList()); } Contingency(String id, ContingencyElement... elements);  Contingency(String id, List<ContingencyElement> elements); static List<Contingency> checkValidity(List<Contingency> contingencies, Network network); String getId(); void setId(String id); void addElement(ContingencyElement element); void removeElement(ContingencyElement element); Collection<ContingencyElement> getElements(); ModificationTask toTask(); @Override int hashCode(); @Override boolean equals(Object obj); }
Contingency extends AbstractExtendable<Contingency> { public static List<Contingency> checkValidity(List<Contingency> contingencies, Network network) { Objects.requireNonNull(contingencies); Objects.requireNonNull(network); return contingencies.stream() .filter(c -> isValid(c, network)) .collect(Collectors.toList()); } Contingency(String id, ContingencyElement... elements);  Contingency(String id, List<ContingencyElement> elements); static List<Contingency> checkValidity(List<Contingency> contingencies, Network network); String getId(); void setId(String id); void addElement(ContingencyElement element); void removeElement(ContingencyElement element); Collection<ContingencyElement> getElements(); ModificationTask toTask(); @Override int hashCode(); @Override boolean equals(Object obj);  }