All states have laws that prohibit drivers from making unsafe lane changes. Here are some of the basics about these laws and possible defenses to an unsafe-lane-change ticket.
Most state unsafe-lane-change laws say something like this:
Whenever any roadway has been divided into two or more clearly marked lanes for traffic in one direction, the following rule applies: A vehicle shall be driven as nearly as practicable entirely within a single lane and shall not be moved from the lane until such movement can be made with reasonable safety.
So, generally, these types of laws require drivers to stay in their own lane (unless there are unusual circumstances justifying otherwise) and change lanes only in a safe manner.
Most drivers are on their best behavior when a police cruiser is close. So officers end up issuing many violations that they view from a distance, meaning their ability to judge the nuances of whether particular conduct was safe or not is poor. If this was true in your case, you'll likely want to ask the officer during cross-examination where he or she was located in relation to where the alleged violation occurred. You can also address this issue in your own testimony.
Because unsafe-lane-change violations hinge on whether the driver's actions were reasonably safe or not, it can be beneficial in fighting one of these tickets to point to any factors that tend to show the lane change was made under safe circumstances. For example, factors like clear weather and good road conditions would tend to support an argument that the lane change was safe.
Also, if another driver coming up behind you was driving unreasonably fast, resulting in that car being close to your vehicle following your lane change, it might help to explain these circumstances when you testify.