field = (Hex)iter.next();
field = (IHex)iter.next();
    protected static void placeSomeTerrain(IBoard board, int terrainType, int probMore,int minHexes, int maxHexes, HashMap reverseHex) {        Point p = new Point(Compute.randomInt(board.getWidth()),Compute.randomInt(board.getHeight()));        int count = minHexes;        if ((maxHexes - minHexes) > 0) {            count += Compute.randomInt(maxHexes-minHexes);        }        IHex field;                HashSet alreadyUsed = new HashSet();        HashSet unUsed = new HashSet();        field = board.getHex(p.x, p.y);        if (!field.containsTerrain(terrainType)) {            unUsed.add(field);        } else {            findAllUnused(board, terrainType, alreadyUsed,                    unUsed, field, reverseHex);        }        ITerrainFactory f = Terrains.getTerrainFactory();                for (int i = 0; i < count; i++) {            if (unUsed.isEmpty()) {                return;            }            int which = Compute.randomInt(unUsed.size());            Iterator iter = unUsed.iterator();            for (int n = 0; n < (which - 1); n++)                iter.next();            field = (Hex)iter.next();            field.removeAllTerrains();            int tempInt = (Compute.randomInt(100) < probMore)? 2 : 1;            ITerrain tempTerrain = f.createTerrain(terrainType, tempInt);            field.addTerrain(tempTerrain);            unUsed.remove(field);            findAllUnused(board, terrainType, alreadyUsed, unUsed, field, reverseHex);        }                if (terrainType == Terrains.WATER) {            /* if next to an Water Hex is an lower lvl lower the hex.             First we search for lowest Hex next to the lake */            int min = Integer.MAX_VALUE;            Iterator iter = unUsed.iterator();            while (iter.hasNext()) {                field = (Hex)iter.next();                if (field.getElevation() < min) {                    min = field.getElevation();                }            }            iter = alreadyUsed.iterator();            while (iter.hasNext()) {                field = (Hex)iter.next();                field.setElevation(min);            }                    }    }