@Test
public void testCAS2EntsoeLoadFlowExplicitLineAndPhaseShifterMovedToEnd1() {

    BranchTestCase line = cas2EntsoeLoadFlowExplicitLine();
    BranchTestCase pst = cas2EntsoeLoadFlowExplicitPhaseShiftTransformer();
    Flow load = cas2EntsoeLoadFlowExplicitLoad();
    Flow generator = cas2EntsoeLoadFlowExplicitGenerator();
    // Move phase shift from end 2 to end 1
    pst.branch.end1.tap.rho = 1 / pst.branch.end2.tap.rho;
    pst.branch.end1.tap.alpha = -pst.branch.end2.tap.alpha;
    double rho2square = pst.branch.end2.tap.rho * pst.branch.end2.tap.rho;
    double dz = 100 * (1 / rho2square - 1);
    double dy = 100 * (rho2square - 1);
    pst.branch.end1.tap.r = dz;
    pst.branch.end1.tap.x = dz;
    pst.branch.end1.tap.g = dy;
    pst.branch.end1.tap.b = dy;
    pst.branch.end2.tap.rho = 1;
    pst.branch.end2.tap.alpha = 0;
    BranchData pline = piModelFlows(line);
    BranchData ppst = piModelFlows(pst);
    LOG.debug("");
    LOG.debug("Balance at ends of parallel branches " + pline.getId() + ", " + ppst.getId());
    LOG.debug("After moving phase shifter to side 1");
    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);
}