SALEM – A Lynn man caught twice peddling heroin to an undercover officer last year was sentenced to serve four years in state prison after pleading guilty.William Alicea, 41, also known as Osvaldo Fuentes, formerly of 46 Wyman St., Lynn, made his plea Friday in Salem Superior Court to two counts of distribution of heroin before Judge John T. Lu.The judge agreed to follow the recommendation offered to the court by Assistant District Attorney John B. Brennan and defense lawyer Scott F. Gleason.Brennan told the judge he was prepared to establish at trial that Alicea twice sold heroin to an undercover officer in 2010.In January of 2010 Essex County Drug Task Force members began working on an investigation after receiving a cell phone number and to ask for “Jose,” who was later identified as Alicea.A call was made and a meeting was arranged to negotiate the deal.On Jan. 5, the undercover trooper and Alicea met in the downtown area of Lynn where 10 grams of heroin were sold to the undercover officer for $700.Then a little over two weeks later a second deal was consummated on the afternoon of Jan. 21 where four fingers of heroin were sold to the undercover police officer for $2,100 on Chatham Street.Alicea was arrested by police without incident after completing the second deal.During booking police learned that Alicea had two birthdays and was using another name, Osvaldo Fuentes, said Brennan.Brennan told Lu that the recommendation proposed was negotiated for “several months” and “this is ultimately an acceptable sentence,” as he asked the judge to impose the penalty suggested.The judge credited Alicea the 524 days he has spent in jail in lieu of bail awaiting trial on the case.