@Test
public void testHvdc() {

    Network network = HvdcTestNetwork.createLcc();
    assertEquals(1, network.getHvdcLineCount());
    NetworkReducerObserverImpl observer = new NetworkReducerObserverImpl();
    // Keeping both end of the HVDC is OK
    NetworkReducer reducer = NetworkReducer.builder()
            .withNetworkPredicate(IdentifierNetworkPredicate.of("VL1", "VL2"))
            .withObservers(observer)
            .build();
    reducer.reduce(network);
    assertEquals(1, network.getHvdcLineCount());
    assertEquals(0, observer.getHvdcLineReplacedCount());
    assertEquals(0, observer.getHvdcLineRemovedCount());
    // Keeping none of the ends of the HVDC is OK
    reducer = NetworkReducer.builder()
            .withNetworkPredicate(new IdentifierNetworkPredicate(Collections.emptyList()))
            .withObservers(Collections.singleton(observer))
            .build();
    reducer.reduce(network);
    assertEquals(0, network.getHvdcLineCount());
    assertEquals(0, observer.getHvdcLineReplacedCount());
    assertEquals(1, observer.getHvdcLineRemovedCount());
}