### Question:
NotCondition implements TransitionCondition { @Override public boolean allow(Object event, Object entity, State state) { return !(condition.allow(event, entity, state)); } NotCondition(TransitionCondition condition); @Override boolean allow(Object event, Object entity, State state);  }### Answer:
@Test public void test() { final Mockery context = new Mockery(); final TransitionCondition mockCondition = context.mock(TransitionCondition.class); final State mockState = new State("test", StateType.ACTIVE); NotCondition n1 = new NotCondition(mockCondition); context.checking(new Expectations() { { oneOf(mockCondition).allow(with(event), with(entity), with(mockState)); will(returnValue(true)); } }); assertFalse(n1.allow(event, entity, mockState)); context.assertIsSatisfied(); context.checking(new Expectations() { { oneOf(mockCondition).allow(with(event), with(entity), with(mockState)); will(returnValue(false)); } }); assertTrue(n1.allow(event, entity, mockState)); context.assertIsSatisfied(); }