title: Using Scala's groupBy with "eligible deviation"
body: <p>I have:</p>
  
  <pre><code>val a = List((1.1, 2), (1.2, 3), (3.1, 4), (2.9, 5))
  </code></pre>
  
  <p>I want to group this list with "eligible deviation", or in other words: group every double with doubles that are bigger/smaller than itself.</p>
  
  <p>The result I want (Let's say that the eligible deviation here is 0.2):</p>
  
  <pre><code>Map((1.1, 1.2) -&gt; List((1.1, 2),(1.2, 3)), (3.1, 2.9) -&gt; List((3.1, 4), (2.9, 5)))
  </code></pre>
  
  <p>How can I do this?</p>