title: Converting C# to Java, how do I handle IEnumerable?
body: <p>I've been tasked with converting some C# code to Java. Most of it is fine, but I am having some trouble working out how to translate IEnumerable.</p>
  
  <p>The code I have in C# is this:</p>
  
  <pre><code>public IEnumerable&lt;Cat&gt; Reorder(IEnumerable&lt;Cat&gt; catList)
  {
  
    // some logic that reorders the list
  
  }
  </code></pre>
  
  <p>My googling suggested that I should be using <code>Iterable&lt;Cat&gt;</code> as an alternative. However, I also stumbled upon something saying you should never have <code>Iterable&lt;T&gt;</code> as a return type.</p>
  
  <p>I'm a bit unfamiliar with data structures in Java. What should I be returning, and how would you re-order a collection of objects?</p>
  
  <p>In C#, assuming you don't use linq, you'd create an empty array or List or similar, and add the items in as you repeatedly iterate through them, checking the criteria. Which data structure would I use in Java to achieve this?</p>