title: Loop with NetApp API-Runner
body: <p>Big Picture: I created two Java-Classes, one to get Output from a NetApp Simulator and another to create a JTable with Volume names and specifications.</p>
  
  <p>The Code for the JTable is "exactly" this one:
  <a href="https://stackoverflow.com/questions/18645948/java-console-output-in-jtable">Java: Console output in JTable</a></p>
  
  <p>Sample Code to get the Volume names:</p>
  
  <pre><code>public static Object VolName() {
  
      ApiRunner runner = new ApiRunner(ApiTarget.builder()
  
      .withHost(host).withUserName(user).withPassword(pass)
              .withTargetType(TargetType.FILER).useHttp().build());
  
      VolumeListInfoIterStartRequest volListReq = new VolumeListInfoIterStartRequest();
  
      Iterator&lt;VolumeInfo&gt; volumeIter = runner.iterate(volListReq, 20);
  
      VolumeInfo volume = null;
      while(volumeIter.hasNext()) {
          volume = volumeIter.next();
          System.out.println("Sample 1: " + volume.getName());
  
      }
      System.out.println("Sample 2: " + volume.getName());
      return volume.getName();
  
  }
  </code></pre>
  
  <p>The Java-Commands which are from a NetApp Java Library.</p>
  
  <p>Now to explain the Problem the Console output:</p>
  
  <pre><code>Sample 1: volume1
  Sample 1: volume2
  Sample 1: volume3
  Sample 1: volume4
  Sample 1: volume5
  Sample 2: volume5
  </code></pre>
  
  <p>My return value is always volume5. How do I create an array out of this method or another method to loop this values?</p>
  
  <p>Sorry for my poor English.</p>