According to this article posted by the Boston Police Department, on Monday, July 4, 2016 officers of the Youth Violence Strike Force located an 18 year old Roxbury resident wanted for Assault with Intent to Murder among other charges, in the company of two other individuals. After arresting the person they were looking for, the officers apparently pat frisked the other people present and discovered a loaded Smith & Wesson .22 long rifle in a backpack worn by one of the males. The person with the gun was then arrested and charged with Unlawful Possession of a Firearm, Unlawful Possession of Ammunition, and Unlawfully Carrying a Loaded Firearm.
Notice, however, that the police had no reason whatsover (at least according to the article) to pat-frisk the other people present at the arrest, except for the fact that they happened to be there. This would actually be lawful in some jurisdictions, such as California, under something called the "automatic companion" rule. However, in 1995, in a case called Commonwealth v. Wing Ng, the Massachusetts Supreme Judicial Court rejected the automatic companion rule under the Massachusetts Declaration of Rights.
Without the automatic companion rule, in Massachusetts the police would have to have reason to suspect that the people found on the scene of the arrest were both armed and dangerous before they would have the right to search them. It doesn't sound like they had any reason to think that about the person on whom they found the firearm in this case, and the gun should therefore be suppressed, and the case thrown out.