title: Generate random objects in Java
body: <p>im doing a performance review of graphdatabases in context of process modelling.
  Therefore I set up a simple testcase which tracks the performance of simple inserts into the embedded N4J database. This is an excerpt of my testcase.</p>
  
  <pre><code>@Test
      public void insertQuants(){
          int size =750;
          /**
           * create 10 different languages and store them in the ArrayList
           */
          ArrayList&lt;Language&gt; lngs = new ArrayList&lt;Language&gt;();
          for(int i=0; i&lt;10; i++){
              String title = "Testsprache " + String.valueOf(i);
              String description = "Beschreibung " +String.valueOf(i); 
              lngs.add(modelservice.createLanguage(title,description));
          }           
          /**
           * Create different models and assign them to different
           * language objects
           */
          for(int i=0; i&lt;size; i++){
              String title = "Testmodel " + String.valueOf(i);
              //get random between 0 and 9
              int fin = (int) Math.round(Math.random()*9);
              //fetch random Language object out of ArrayList
              Language l = lngs.get(fin);
              Model m = modelservice.createModel(l, title);
              l.addModel(m);
              template.save(l);
          }
  </code></pre>
  
  <p>the methods createModel in modelservice return the specific created object ( model or language ).
  The issue i'm currently facing is that the random assigning of languages to models is not working. The Script assigns each model to one language object. In my mind it rather should randomly assign languages to model.</p>