### Question:
AndCondition implements TransitionCondition { @Override public boolean allow(Object event, Object entity, State state) { for (TransitionCondition condition : conditions) { if (!condition.allow(event, entity, state)) return false; } return true; } AndCondition(TransitionCondition... conditions); @Override boolean allow(Object event, Object entity, State state);  }### Answer:
@Test public void test() { final Random rand = new Random(); final int conditionCount = rand.nextInt(20) + 1; final TransitionCondition[] alwaysTrue = new TransitionCondition[conditionCount]; for (int i = 0; i < alwaysTrue.length; i++) { alwaysTrue[i] = TransitionCondition.ALWAYS; } AndCondition condition = new AndCondition(alwaysTrue); assertTrue(condition.allow(null, null, null)); for (int i = 0; i < 10; i++) { TransitionCondition[] mixed = Arrays.copyOf(alwaysTrue, alwaysTrue.length); int elementsToChange = rand.nextInt(mixed.length) + 1; for (int j = 0; j < elementsToChange; j++) { mixed[rand.nextInt(mixed.length)] = NEVER; } condition = new AndCondition(mixed); assertFalse(condition.allow(null, null, null)); } final TransitionCondition[] alwaysFalse = new TransitionCondition[conditionCount]; Arrays.fill(alwaysFalse, NEVER); condition = new AndCondition(alwaysFalse); assertFalse(condition.allow(null, null, null)); }