This is one reason you NEVER go to court without a lawyer, NEVER!
Even telling a white lie to a cop is a felony everywhere in this country.