System.out.println("->TIE: " + ((Team)item).getId()); rollInitAndResolveTies(ties, null);
rollInitAndResolveTies(ties, null);
    public static void rollInitAndResolveTies(Vector v, Vector rerollRequests) {        for (Enumeration i = v.elements(); i.hasMoreElements();) {            final TurnOrdered item = (TurnOrdered)i.nextElement();            if (rerollRequests == null) { //normal init roll                item.getInitiative().addRoll(); // add a roll for all teams            } else {                //Resolve Tactical Genius (lvl 3) pilot ability                for (Enumeration j = rerollRequests.elements(); j.hasMoreElements();) {                    final TurnOrdered rerollItem = (TurnOrdered)j.nextElement();                    if (item == rerollItem) { // this is the team re-rolling                        item.getInitiative().replaceRoll();                        break; // each team only needs one reroll                    }                }            }        }        // check for ties        Vector ties = new Vector();        for (Enumeration i = v.elements(); i.hasMoreElements();) {            final TurnOrdered item = (TurnOrdered)i.nextElement();            ties.removeAllElements();            ties.addElement(item);            for (Enumeration j = v.elements(); j.hasMoreElements();) {                final TurnOrdered other = (TurnOrdered)j.nextElement();                if (item != other && item.getInitiative().equals(other.getInitiative())) {                    ties.addElement(other);                }            }            if (ties.size() > 1) {                System.out.println("->TIE: " + ((Team)item).getId());                rollInitAndResolveTies(ties, null); // null should be reroll? debug            }        }    }