title: how to compare three array values?
body: <p>I am having three array's </p>
  
  <p>1) serviceDetails</p>
  
  <p>2) documentIdArray</p>
  
  <p>3) servicesArray.</p>
  
  <p>I want to compare <code>serviceDetails</code> with <code>documentIdArray</code> and if any values matches, I want to get values from <code>servicesArray</code> in that position.    </p>
  
  <pre><code>serviceDetails = (ArrayList&lt;String&gt;) task.getResult().getDocuments().get(position).get("services");`
          for(int i=0;i&lt;serviceDetails.size();i++){
              if(serviceDetails.get(i).equals(documentIdArray.get(i))){
                  String strService=serviceListArray.get(i);
                  servicesArray.add(strService);
                  ((listViewHolder)holder).serviceTv.setText(servicesArray.toString());
  
              }
          }
  </code></pre>
  
  <p>Example:</p>
  
  <pre><code>serviceDetails=(a,b,c,d) documentIdArray=(b,a,f,d) serviceListArray=(1,2,3,4)
  output:servicesArray=(2,1,4)
  </code></pre>