title: add element to iterable in java
body: <p>I have the following code:</p>
  
  <pre><code>public class Router {
    private Iterable&lt;Route&gt; routes;
  
    public Router(Iterable&lt;Route&gt; routes) {
      this.routes = routes;
    }
    public void addRoute(Route route) {
      routes.add(route);\\problem is here
    }
  }
  </code></pre>
  
  <p>I highlighted the line which is not working. Here I try to add a new object to the routes. In main file routes are:</p>
  
  <pre><code>public class RouterMain 
  {
      public static void main(String[] arg) throws IllegalArgumentException 
      {
          List&lt;Route&gt; routes = new ArrayList&lt;Route&gt;();
          Router router = new Router(routes);
      }
  }
  </code></pre>
  
  <p>The task is to add an object in iterable object in <code>Router</code> class. As I understood <code>Iterable</code> can iterate, not add something. So what should I do, convert routes in <code>Router</code> class to a <code>List</code>, add an element and go back?</p>