In broad general terms, under UK law, how would you begin constructing a defence that questions the validity of the law you are being charged under.
For instance say I was a black American woman sat at the front of the bus, and I was charged as such.
I don't wish to plead guilty of the non crime of being a black American at the front of the bus, neither do I want to deny that I did nothing wrong by sitting at the front of the bus.
I'm asking generally as a lay person concerned about recent developments in the UK, under the assumption that a legal system must contain some checks and balances to allow the electorate to challenge laws passed by the state if they feel the state has overstepped it's boundary and passed a dangerous law. Breaking said law and being arrested as such as an act of civil disobedience will obviously result in a criminal hearing.
How could such a situation be used to challenge said law in court.