you can request a hearing to bring in evidence of what actually occurred. Bring your witness and a diagram of the intersection and look up the statute the officer used. To prove his case the officer must bring in the truck driver as the officer did not see what happened. Sometimes neither will show up for the hearing and you will win automatically. Make sure your passenger does go to court with you.
I do not practice law in mass. and these remarks should not be entirely relied upon as such.
You should be sure that the advice you get is from attorneys licenses in Massachusetts and that are familiar with the process. The first hearing will be before a clerk magistrate with a representative of the police department who will read the citation and notes made by the officer. You will present your side and the magistrate will make a finding of responsible, or not responsible. You will be responsible if the magistrate determines that more likely than not you committed the offense charged. If you are found responsible, you can appeal to a judge when the officer that wrote the citation must be present, and witnesses can testify if needed. It appears that the officer felt that your driving was too aggressive, but only cited for improper passing.
You may wish to consult with an attorney to review the charge, the controlling law, and your statement and offer an opinion, and even represent you. It may be worth the expense of an attorney to at least provide an opinion of the situation.
DISCLAIMER: This answer is provided in response to a "hypothetical" question and provided for general, informational purposes and does not create an attorney/client relationship. The information presented is not legal advice and may change based additional information and research. It is recommended that you speak to an attorney to discuss your specific legal issues.
The best advice I give motorists is to be respectful to the officer or Trooper when being stopped. In close cases like yours, this can often be the difference between a warning and a citation. Even if you get a citation, continue to be polite. Officers remember unruly or disrespectful motorists, and may mark your citation such that they and their colleagues are sure to fight you during your appeal.
Assuming you have followed this advice on the road, your next step is the first-level hearing before a clerk magistrate, Unfortunately, traffic hearings have little to do with credibility and more to do with your driving history. If you have a clean record, the clerk magistrate may allow your appeal on that basis alone. At all levels you must be polite and respectful to the police representative and court personnel.
If your are unsuccessful, appeal it to a judge's hearing (twenty dollars for the appeal) and plead your case to a judge. Here, unlike at the clerk's hearing, the officer who issued the citation must appear. Be respectful of the officer, suggest that he may have been mistaken (never say he or she is lying), give your testimony in clear language and make it plausible, and you may succeed.