private Enumeration iter = Game.this.getEntities();
private Enumeration iter = getEntities();
    public Enumeration getSelectedEntities( EntitySelector selector ) {        Enumeration retVal;        // If no selector was supplied, return all entities.        if ( null == selector ) {            retVal = this.getEntities();        }        // Otherwise, return an anonymous Enumeration        // that selects entities in this game.        else {            final EntitySelector entry = selector;            retVal = new Enumeration() {                    private EntitySelector selector = entry;                    private Entity current = null;                    private Enumeration iter = Game.this.getEntities();                    // Do any more entities meet the selection criteria?                    public boolean hasMoreElements() {                        // See if we have a pre-approved entity.                        if ( null == current ) {                            // Find the first acceptable entity                            while ( null == current &&                                    iter.hasMoreElements() ) {                                current = (Entity) iter.nextElement();                                if ( !selector.accept( current ) ) {                                    current = null;                                }                            }                        }                        return ( null != current );                    }                    // Get the next entity that meets the selection criteria.                    public Object nextElement() {                        // Pre-approve an entity.                        if ( !this.hasMoreElements() ) {                            return null;                        }                        // Use the pre-approved entity, and null out our reference.                        Entity next = this.current;                        this.current = null;                        return next;                    }                };        } // End use-selector        // Return the selected entities.        return retVal;    }