title: Does the list returned from Arrays.asList maintain the same order as the original array collection?
body: <p>I've got an ArrayList that I'm iterating over several times, and it looks like it isn't maintaining the order of iteration. I looked deeper, and it appears that the custom iterator tag that was written for this iteration (by someone else) is first taking the passed in ArrayList and using Arrays.asList to bridge it to an Object[] collection before iterating. Is the order of iteration being lost? Is that expected with Arrays.asList?</p>
  
  <p>EDIT:</p>
  
  <p>Here is the what the operation does with the original collection passed into the iterator tag:</p>
  
  <pre><code>if(collection.getClass().isArray()) {
      iterator = Arrays.asList((Object[]) collection).iterator();
  } else if(collection instanceof Collection) {
      iterator = ((Collection) collection).iterator();
  } else if(collection instanceof Iterator) {
      iterator = (Iterator) collection;
  } else if(collection instanceof Map) {
      iterator = ((Map) collection).entrySet().iterator();
  }
  </code></pre>