Joe McLaughlin did something that few do at New York’s highest court. He got a laugh out of the judges.

It came at the end of his arguments before the Court of Appeals in early June—and presaged a major win this week for his client, Bank of America subsidiary Countrywide Home Loans.