title: Java method to check consecutive numbers
body: <p>I need to write a method called consecutive which takes in 6 parameters to check if the 6 inputs are consecutive numbers regardless of order. If the numbers are consecutive, it returns a true, otherwise false. Can someone teach me what is the most efficient way of doing so? I tried this method but it would be inefficient if i have 6 numbers ?</p>
  
  <pre><code>public static boolean consecutive(int numberOne,int numberTwo,int numberThree) {
      if(((numberTwo==numberOne-1) &amp;&amp; (numberThree== numberTwo-1)) || ((numberTwo==numberOne+1) &amp;&amp; (numberThree==numberTwo+1)) || ((numberTwo==numberOne+2) &amp;&amp;( numberThree==numberOne+1)) || ((numberTwo==numberOne-1)&amp;&amp; (numberThree==numberOne+1)) || ((numberTwo==numberOne-2) &amp;&amp; (numberThree==numberOne-1)) ||((numberTwo==numberOne+1) &amp;&amp; (numberThree==numberOne-1))){
          return true;
      }else{
          return false;
      }
  }
  
  }
  </code></pre>