title: How to use a Ruby-style map on a Java vector?
body: <p>I have a feeling this is a question that Google could quickly answer if I knew the Java terminology for what I want to do, but I don't, so in Stack Overflow I trust. :)</p>
  
  <p>I have a vector of <code>Object</code>s, and I want an array of <code>String</code>s containing the string representation of each element in the vector, as generated by calling <code>toString()</code> on each element.</p>
  
  <p>In Ruby (or Perl, or Python, or Scheme, or any of the millions of other languages with a <code>map</code> method), here's how I'd do it:</p>
  
  <pre><code>vector.map(&amp;:to_s) do |string|
    # do stuff
  end
  </code></pre>
  
  <p>How can I do the equivalent in Java? I'd like to write something like this:</p>
  
  <pre><code>Vector&lt;Object&gt; vector = ...;
  String[] strings = vector.map(somethingThatMagicallyCallsToString);
  </code></pre>
  
  <p>Any ideas?</p>