This is 100% preventable.
That guy clearly never took the MSF course. You simply do not ride in people’s blind spot and “expect” drivers to shoulder check or use signal 100% of the time “before” they change lanes.
Unless you absolutely have no choice, ride clear either in front or behind the car next to you.