Possible Duplicate:
Mocking Java enum to add a value to test fail case
I have a switch statement that works on an enum. The "default" case of the switch is to throw a runtime exception. It's coded like this to trap the situation where someone adds a value to the enum but forgets to update the switch statement.
I want to test this execution path, but I am struggling to find a way of doing so without putting an unused enum value into my live code. Is this a misuse of enum, or is there an accepted way of writing this test?