@Test
public void testDanglingLine() {

    Network network = EurostagTutorialExample1Factory.createWithLFResults();
    NetworkReducer reducer = NetworkReducer.builder()
            .withNetworkPredicate(IdentifierNetworkPredicate.of("P2"))
            .withDanglingLines(true)
            .build();
    reducer.reduce(network);
    assertEquals(1, network.getSubstationCount());
    assertEquals(2, network.getVoltageLevelCount());
    assertEquals(1, network.getTwoWindingsTransformerCount());
    assertEquals(0, network.getLineCount());
    assertEquals(0, network.getGeneratorCount());
    assertEquals(1, network.getLoadCount());
    assertEquals(2, network.getDanglingLineCount());
    DanglingLine dl1 = network.getDanglingLine(NHV1_NHV2_1);
    assertNotNull(dl1);
    assertEquals(1.5, dl1.getR(), 0.0);
    assertEquals(16.5, dl1.getX(), 0.0);
    assertEquals(0.0, dl1.getG(), 0.0);
    assertEquals(1.93e-4, dl1.getB(), 0.0);
    assertEquals(-300.43389892578125, dl1.getP0(), 0.0);
    assertEquals(-137.18849182128906, dl1.getQ0(), 0.0);
    assertEquals(-300.43389892578125, dl1.getTerminal().getP(), 0.0);
    assertEquals(-137.18849182128906, dl1.getTerminal().getQ(), 0.0);
    DanglingLine dl2 = network.getDanglingLine(NHV1_NHV2_2);
    assertNotNull(dl2);
    assertEquals(1.5, dl2.getR(), 0.0);
    assertEquals(16.5, dl2.getX(), 0.0);
    assertEquals(0.0, dl2.getG(), 0.0);
    assertEquals(1.93e-4, dl2.getB(), 0.0);
    assertEquals(-300.43389892578125, dl2.getP0(), 0.0);
    assertEquals(-137.18849182128906, dl2.getQ0(), 0.0);
    assertEquals(-300.43389892578125, dl2.getTerminal().getP(), 0.0);
    assertEquals(-137.18849182128906, dl2.getTerminal().getQ(), 0.0);
}