title: split an integer list into 2 list of approximately the same length in Java
body: <p>I am trying to split a list of integers into 2 lists of approximately equal length if my main list can't be evenly divided</p>
  
  <p>My code so far is covering the "even split":</p>
  
  <pre><code>@Override
  public Set&lt;Bin&gt; pack(int capacity, List&lt;Integer&gt; values) {
      /**
       * Divide the list into 2 equal parts if it can be Divided evenly
       * Else, divide the List into 2 parts of roughly the same length
       */
      int temp =values.size();
      if(temp % 2 == 0)
      {
          ArrayList&lt;Integer&gt; list1 = new ArrayList&lt;Integer&gt;();
          ArrayList&lt;Integer&gt; list2 = new ArrayList&lt;Integer&gt;();
  
          for(int i = 0; i &lt; temp / 2;i++)
          {
              list1.add(i);
          }
          for(int i = temp / 2; i &lt; values.size();i++)
          {
              list1.add(i);
          }
      }else //divide the list into 2 approximately equal parts
      {
  
  
      }
      return null;
  }
  </code></pre>
  
  <p>How do I implement the rest of this method?</p>