Question: Is there a way to increase the for-loop range in java? I have the following code:

```
for (DataRoot bri : Ri)
    {
        for (DataRoot brcom : complemento)
        {
            if (bri.getMesa().equals(brcom.getMesa()))
            {
                if (found) {found = false; break;}
                postrecom = brcom.getOrden().getPostres();
                Calendar dateri = Calendar.getInstance();
                Calendar datecom = Calendar.getInstance();
                dateri.setTime(bri.getFechaorden());

                for (Postres proc : postrecom)
                {
                   // if (found) {found = false; break;}
                    datecom.setTime(proc.getHora_plato());
                    long diff = datecom.getTimeInMillis() - dateri.getTimeInMillis();

                    if ( diff > (3*60*1000))
                    {
                        found = true;
                        Ri.add(brcom);
                        break;

                    }
                    else
                    {
                        bri.getOrden().getPostres().add(proc);
                        setBase();

                    }
                }
            }
        }
        }

```

As you can notice, if some conditions are met, the Array "Ri" which is the main array will increase its content, lets say from 3 items to 4, at the start, the loop was going to be from 0 to 2 but as it got a new element I need it to keep running from 0 to 3 but the range will not dynamically increase as new items are added.

I could count how many items I added to "Ri" So that I can call that many times this method but if I do so, the compiler witll give me the "java.util.ConcurrentModificationException" error at this point I dont know what to do any help would be appreciated.

Answer: 
Toree is still in development version, so it's not currently located in the pypi. You will have to install it like this:

```
pip install https://dist.apache.org/repos/dist/dev/incubator/toree/0.2.0/snapshots/dev1/toree-pip/toree-0.2.0.dev1.tar.gz
jupyter toree install

```

You can see this page for more details
<https://github.com/apache/incubator-toree/blob/master/README.md>
When pip says something like this, it means that it doesn't find toree at all: it may not have the module. The module can be installed once you download a package which can be taken from this link:

<http://spark.apache.org/downloads.html>