title: Get certain element range in a List<long> based on some conditions
body: <ul>
  <li>I have 2 <code>List&lt;long&gt;</code> (<code>valueCov</code> and <code>valueWat</code>) with <code>long</code> data typed values.</li>
  <li>When a certain list element is not found I need to get the next
  closer element with least different of the searching value.</li>
  </ul>
  
  <p><strong>For that:</strong></p>
  
  <ul>
  <li><p>I'm iterating through valueWat's elements(x) and if there is no exact
  match for it in <code>valueCov</code>,then into that else part I need to find the
  very closest element to "x".</p></li>
  <li><p>I need a solution/method of finding closest next element from that
  <code>List</code>.</p></li>
  </ul>
  
  <p>Code Segment:</p>
  
  <pre><code>foreach (var y in sortedCov){
                      valueCov.Add(y.Value);
                  }
                  //Console.WriteLine("initial" + valueCov.Count);
                  foreach (var x in valueWat){
                      //foreach (var y in valueCov){
                         // var keys = new List&lt;long&gt;(y.Value);
                              int index = valueCov.BinarySearch(x);
                              int lower;
                              int upper;
                                  if (index &gt;= 0) {
                                    lower = upper = index;
                                    blockedWaterCoverMap.Add(x, valueCov[index]);
                                    valueCov.RemoveAt(index);
                                                  }
                                  else  {
                                      //foreach (var y in valueCov){
                                          //subListCov = valueCov.FindAll((y &lt; x + 7) &amp;&amp; (y &gt; x - 7));
                                         // }
  
                                        }
  </code></pre>