@Test
public void testCAS2EntsoeLoadFlowExplicitLineAndPhaseShifter() {

    BranchTestCase line = cas2EntsoeLoadFlowExplicitLine();
    BranchTestCase pst = cas2EntsoeLoadFlowExplicitPhaseShiftTransformer();
    Flow load = cas2EntsoeLoadFlowExplicitLoad();
    Flow generator = cas2EntsoeLoadFlowExplicitGenerator();
    // Obtain flows at both ends of line and phase shifter
    BranchData pline = piModelFlows(line);
    BranchData ppst = piModelFlows(pst);
    // And check bus balance at each side
    // At end1 (load) the mismatch should be zero
    // because load values are given with all significant digits
    // and voltages have been copied from Excel documentation,
    // where they have sufficient precision
    // At end2 (generator, slack bus) the mismatch should be small:
    // generator injection in P and Q are provided with low precision
    // (P with 10e-2, Q with 10e-4)
    LOG.debug("");
    LOG.debug("Balance at ends of parallel branches " + pline.getId() + ", " + ppst.getId());
    Flow line1 = flow(pline, Side.ONE);
    Flow line2 = flow(pline, Side.TWO);
    Flow pst1 = flow(ppst, Side.ONE);
    Flow pst2 = flow(ppst, Side.TWO);
    checkBusBalance("End 1", TOLERANCE_BALANCE_EXACT, TOLERANCE_BALANCE_EXACT, line1, pst1, load);
    checkBusBalance("End 2", 1e-2, 1e-4, line2, pst2, generator);
}