The picture painted in court of the New York Police Department’s officers was not pretty.

Ten percent of them were malcontents who worked as little as possible. Unless they are being paid overtime, officers seem to avoid writing summonses. Indeed, some police officers need to be weaned of the idea that they are paid to drive around in their patrol cars, eating doughnuts.

And those sentiments came not from critics of the department, but from police commanders and city lawyers.

One of the surprising developments of the trial regarding the Police Department’s stop-and-frisk practices is how top police officials and city lawyers have been willing to criticize some of the department’s rank-and-file officers — all in an effort to counter testimony from whistle-blower officers who say that commanders had created quotas that pressured them to make street stops without the proper grounds.

Some of the testimony heard over the first six weeks of the trial in Federal District Court in Manhattan has had more in keeping with labor arbitration than with a constitutional case, as the city has tried to play down secret station house recordings, partly by characterizing some police officers as lazy.