Barclays Plc's top two executives will tell a New York court this week that the British bank did not receive an unfair windfall from a deal for parts of Lehman Brothers in a case that shows the need for banks to draw up living wills.

Barclays President Bob Diamond is due to appear on Monday, followed a day later by Chief Executive John Varley. Creditors of Lehman Brothers accuse Barclays of taking advantage of the investment bank's collapse to obtain an $11 billion windfall from Barclays' takeover of Lehman's U.S. operations.

Lehman creditors want the judge, who approved the transaction 21 months ago, to review the sale.

In testimony in New York bankruptcy court early on Monday, Lehman Brothers Holdings Chief Executive Bryan Marsal said he had believed that the purchase of Lehman would be a wash but that Barclays quarterly earnings, released after absorbing Lehman, indicated there'd been a substantial built-in gain from the transaction itself, which would suggest that net assets received were greater than liabilities assumed.

A Barclays explanation did not adequately answer Marsal's questions on why there had been a gain, he said, and it became clear there was a significant disagreement between Lehman estate and Barclays without an answer on an amount of accrued liabilities, severance and cure.

Upon cross-examination, Marsal said he did not know that Barclays had made press announcements that it would make a gain on the transaction.

Marsal is overseeing the liquidation of the remaining U.S. assets.

Diamond, who heads the Barclays Capital investment bank arm, is scheduled to appear after Marsal's testimony finishes.

Diamond had been due to appear in May, but his testimony was delayed when other witness depositions took longer than expected.

Varley has run Barclays since 2004 and steered his bank through the crisis without any need for state aid. The keen angler and table tennis player, known for his precise language and close attention to detail, was less involved in the transaction and had not been expected to be called.

U.S.-based legal experts have said Lehman faces an uphill battle in proving that Barclays arranged a secret discount and persuading the judge to change the original sale order.

Barclays has said Lehman's assets were inflated when the deal was struck, and it marked them to their true value. It has accused Lehman's lawyers of trying to change the deal after markets improved.

The deal has worked out well for BarCap, delivering bumper profits as capital markets have improved and allowing it to grab market share and add equities and advisory at a time when Wall Street rivals were retreating.

Lehman's bankruptcy in September 2008 was the largest in history, and less than a week later Barclays swooped in on Lehman's flagship U.S. brokerage business for about $1.85 billion.

The case has shown how frantic conditions were during Lehman's final days and is evidence of the need for banks to set up so-called living wills to detail how they should be broken up in the event of collapse, according to regulators and bankers.

Setting up resolution regimes should be one of the main lessons of the financial crisis, the Institute of International Finance said last month, so a bank can collapse in an orderly way without threatening counterparties and spreading risk through the financial system.

The case is In re: Lehman Brothers Holdings Inc, U.S. Bankruptcy Court, Southern District of New York, No. 08-13555.

(Reporting by Steve Slater and Chelsea Emery; Editing by Michael Shields and Matthew Lewis)