### Question:
EventTypeCondition implements TransitionCondition { @Override public boolean allow(Object event, Object entity, State state) { return (type.isInstance(event)); } EventTypeCondition(Class<?> type); @Override boolean allow(Object event, Object entity, State state);  }### Answer:
@Test public void test() { EventTypeCondition condition = new EventTypeCondition(TestEvent.class); assertTrue(condition.allow(event, null, null)); assertFalse(condition.allow(null, null, null)); assertFalse(condition.allow(new Object(), null, null)); assertTrue(condition.allow(new OtherEvent(), null, null)); }