title: How can I create a list of method references?
body: <p>I have a need to work through a list and for each item call a different method on a target object.  It seems elegant that I could just create a list of method references to do this, so for each index in the list, I could call the appropriate method reference that corresponds to it.</p>
  
  <pre><code>private final static List&lt;Consumer&lt;String&gt;&gt; METHODS = (List&lt;Consumer&lt;String&gt;&gt;) Arrays.asList(
       TargetClass::setValue1,
       TargetClass::setValue2,
       TargetClass::setValue3,
       TargetClass::setValue4,
       TargetClass::setValue5);
  </code></pre>
  
  <p>However, Eclipse is flagging these with the error <em>The target type of this expression must be a functional interface</em>.  Now, TargetClass here is a regular class, not an interface ... does that mean there is no way to accomplish what I'm trying to do here?</p>