title: Java: Compare string array with a list of strings and call a setter method of the matched word without sorting the list
body: <p>A <code>String[]</code> needs to be compared with an <code>ArrayList</code>.</p>
  <p>There is a POJO with <code>setXXX()</code> and <code>getXXX()</code>. Now the challenge is, if a word from the array matches with a word from the list:</p>
  <ul>
  <li>I need to get the index/position of the matched word.</li>
  <li>I need to get the value from the next index</li>
  <li>I need to call one of the <code>setXXX()</code> related with the matched word.</li>
  </ul>
  <h1>Fields:</h1>
  <pre><code>String[] s={&quot;email&quot;,&quot;Email&quot;,&quot;email_id&quot;,&quot;Email ID&quot;, &quot;Phone&quot;,&quot;Phone No&quot;,&quot;Phone Number&quot;,&quot;Name&quot;};
  List&lt;String&gt; valueList=new ArrayList&lt;String&gt;;
  </code></pre>
  <p>The <code>valueList</code> is populated dynamically from a text file and may contain values like this :</p>
  <pre><code>&lt;emailID,myemail@gmail.com,ph number,1234567890,name,Ram&gt;
  &lt;Email id, myemail123@xxx.com, phone number,4569871230, name,Rahim&gt;
  </code></pre>
  <p>if the word &quot;email&quot; is matched, then I should call its <code>setEmail</code> method and use the value which is at the next index (i.e. <code>myemail123@xxx.com</code>).</p>
  <h1>Bean:</h1>
  <pre><code>public class WordBeans{
  
      private String email,phone,name;
      
      //all the getXXX and setXXX go here.
  }
  </code></pre>