title: How to get index of findFirst() in java 8?
body: <p>I have the following code:</p>
  
  <pre><code>ArrayList &lt;String&gt; entries = new ArrayList &lt;String&gt;();
  
  entries.add("0");
  entries.add("1");
  entries.add("2");
  entries.add("3");
  
  String firstNotHiddenItem = entries.stream()
                      .filter(e -&gt; e.equals("2"))
                      .findFirst()
                      .get();
  </code></pre>
  
  <p>I need to know what is the index of that first returned element, since I need to edit it inside of entries <code>ArrayList</code>. As far as I know <code>get()</code> returns the value of the element, not a reference. Should I just use</p>
  
  <pre><code>int indexOf(Object o)
  </code></pre>
  
  <p>instead?</p>