Elon Musk is having his day in court.

A trial in which Musk is the sole defendant got underway in Delaware on Monday. The lawsuit, filed by a group of Tesla shareholders, claims that Tesla's purchase of SolarCity in 2016 was more for Musk's benefit than the company's. According to The Washington Post, the shareholders claim in the suit that the purchase amounted to a "bailout" of a solar company that was on the brink of bankruptcy at the time.

The plaintiffs say SolarCity "had consistently failed to turn a profit, had mounting debt, and was burning through cash at an unsustainable rate," according to TechCrunch. The lawsuit says that nearly half the company's $3 billion in debt was due to be paid by the end of 2017.

Musk--Tesla's CEO, co-founder, and largest shareholder--encouraged the company's other shareholders to vote to approve the transaction. Eighty-five percent did. Musk was also SolarCity's largest shareholder at the time of the transaction, and the company was run by two of his cousins, Lyndon and Peter Rive. 

The trial doesn't feature a jury--the ruling will come from a corporate judge. If Musk loses, he will have to pay as much as $2 billion of his own money back to Tesla.

In the courtroom on Monday, Musk argued that the deal would be beneficial for both Tesla and the planet, helping lessen the world's dependency on carbon-emitting fossil fuels.

While pushing for the deal back in 2016, Musk wrote that Tesla and SolarCity were meant to be one company all along and only weren't due to "an accident of history." He added that merging would allow them to combine their technologies and operate more efficiently. Musk's grand vision for Tesla has long included harvesting energy with solar roofs, then storing it in batteries and using it to power electric vehicles--making Tesla a one-stop shop for all things solar energy.

Tesla's solar roofs have run into manufacturing issues and been slow to roll out. In court, Musk blamed much of Tesla's inability to capitalize on its solar division on its need to focus on the Model 3, as well as on challenges brought about by the pandemic.

Regardless of the issues, Tesla's stock is up more than 900 percent since the deal was approved. The company posted its first full year of profitability last year, pulling in about $31.5 billion in sales.