title: Java: How to write a `zip` function? What should be the return type?
body: <p>What should be the return type of a <code>zip</code> function? (<code>zip</code> as in most other languages, e.g. <a href="http://docs.python.org/library/functions.html#zip" rel="noreferrer">read here</a>)</p>
  
  <p>I thought about some Pair-type but that does not exist in Java. It is often states that this is because a specialized Pair-class is better than a general one (see <a href="https://stackoverflow.com/questions/156275/what-is-the-equivalent-of-the-c-pairl-r-in-java">this</a> question). However, this is not possible in a general <code>zip</code> function.</p>