for(Enumeration e = entity.getEquipment(); e.hasMoreElements(); ) { Mounted m = (Mounted) e.nextElement();
for (Mounted m : entity.getEquipment()) {
    public void checkCriticalSlotsForEquipment(Entity entity,            Vector unallocated, Vector allocation, Vector heatSinks)    {        int countInternalHeatSinks = 0;        for(Enumeration e = entity.getEquipment(); e.hasMoreElements(); )        {            Mounted m = (Mounted) e.nextElement();            if (m.getLocation()==Entity.LOC_NONE)            {                if (m.getType() instanceof AmmoType &&                        m.getShotsLeft()==1)                {                    continue;                }                if (!(m.getType() instanceof MiscType))                {                    unallocated.addElement(m);                    continue;                }                MiscType mt = (MiscType) m.getType();                if (mt.hasFlag(MiscType.F_HEAT_SINK) ||                         mt.hasFlag(MiscType.F_DOUBLE_HEAT_SINK))                    countInternalHeatSinks++;                else                {                    unallocated.addElement(m);                    continue;                }            } else if (!criticalSlotsAllocated(entity, m, allocation))            {            }        }        if ((countInternalHeatSinks > engine.integralHeatSinkCapacity()) ||             (countInternalHeatSinks < engine.integralHeatSinkCapacity() &&              countInternalHeatSinks != ((Mech)entity).heatSinks() &&              !entity.isOmni()))        {            heatSinks.addElement(new Integer(countInternalHeatSinks));        }    }