A state court in California has granted class certification to nearly 21,000 current and former Apple employees over claims that the company failed to provide timely meal and rest breaks as required by the law, and sometimes denied workers rest breaks altogether.

In a ruling late Monday, Judge Ronald S. Prager of the Superior Court of California for the County of San Diego granted the class certification for a large group of retail employees and workers at corporate headquarters.

Under California law, employers are generally required to provide 30-minute lunch breaks within an employee’s first five hours at work each day and provide a 10-minute rest break every four hours or major fraction thereof. In addition, California law requires employers to provide a second rest break for shifts that run six to 10 hours, and Judge Prager wrote that the evidence showed that Apple had failed to authorized second rest breaks under these circumstances.

“The common thread here is Apple’s formal policy did not provide for meal periods and rest periods on a timely basis,” said Tyler J. Belong, a lawyer for the plaintiffs.