Twitter is gearing up for a large legal battle ahead with Elon Musk.