title: JavaFX, Casting ArrayList to ObservableList
body: <p>Is there a way to cast <code>ArrayList</code> to <code>ObservableList</code>? I would like to do it without iterating through <code>ArrayList</code>.</p>
  
  <p>To be more specific, I am using ORMLite to get data from database, and I need <code>ObservableList</code> as an output of the method fetching data from DB. </p>
  
  <p>Currently I am doing something like this:</p>
  
  <pre><code>ArrayList&lt;Stavka&gt; listStavaka = new ArrayList&lt;&gt;(); 
  Dao&lt;Stavka, Integer&gt; stavkaDao = DaoManager.createDao(connection, Stavka.class);
  listStavaka = (ArrayList&lt;Stavka&gt;) stavkaDao.queryForAll();
  ObservableList&lt;Stavka&gt; oListStavaka = FXCollections.observableArrayList();
  for (Stavka stavka : listStavaka) {
      oListStavaka.add(stavka);
  }
  </code></pre>
  
  <p>And I would like to do something like this:</p>
  
  <pre><code>ObservableList&lt;Stavka&gt; listStavaka = FXCollections.observableArrayList();
  Dao&lt;Stavka, Integer&gt; stavkaDao = DaoManager.createDao(connection, Stavka.class);
  listStavaka = (ObservableList&lt;Stavka&gt;) stavkaDao.queryForAll();
  </code></pre>