title: Find Last Position of Element in Sorted Array using Collections.binarySearch()
body: <p>I am able to find first using the Collections.binarySearch but how to find the last position of element. Thank you in advance:)</p>
  <pre><code>List &lt; String &gt; nums = new ArrayList &lt; String &gt; ();
      nums.add(&quot;A/tea&quot;);
      nums.add(&quot;C/see&quot;);
      nums.add(&quot;C/sEa&quot;);
      nums.add(&quot;C/SEa&quot;);
      nums.add(&quot;C/clock&quot;);
      nums.add(&quot;aep&quot;);
  
     Collections.sort(nums,String.CASE_INSENSITIVE_ORDER);
     System.out.println(nums);
  
     int pos = Collections.binarySearch(nums,&quot;C/SEA&quot;,String.CASE_INSENSITIVE_ORDER);
  </code></pre>