static S firstPossibleRule(Collection l) { if (l != null) for (S s : l) if (ai_possibleRule(s)) ret s; null; }