title: A request for a complex JUnit test example
body: <p>I am trying to write a suite of JUnit tests for an Android project. For each class that I have written I have a corresponding Test that is extending TestCase. In each of these TestCases I am under the impression that I should write a test() for each  in the class being tested. With that said I do not know how to go about testing methods that deal with multiple possible inputs. I would like to request some examples of testing complex methods that are more complex than the usual tutorial examples.</p>
  
  <pre><code>    public void tutorialTestExample() throws Exception {
      final int expected = 1;
      final int actual = 5;
      assertEquals(expected, actual);
  }
  </code></pre>
  
  <p>Here is a method I am trying to test.</p>
  
  <pre><code>    public void distributeStones(int stones, int trayIndex) {
      if(stones == 0){
          switchPlayer();
      }
      while (stones &gt; 0) {
          if (trayIndex == 15) {
              trayIndex = 0;
          } else {
              trayIndex++;
              if (board.get(trayIndex).getPlayer() == opponent &amp;&amp; board.get(trayIndex).isStore() ) {
                  trayIndex = IncrementTrayIndex(trayIndex);
              }
          }
          if (stones == 1 &amp;&amp; board.get(trayIndex).getPlayer() == currentPlayer &amp;&amp; board.get(trayIndex).isStore()){
              stones--;
              board.get(trayIndex).incrementStones();
              switchPlayer();
          }else if (stones == 1 &amp;&amp; board.get(trayIndex).getStones() == 0 &amp;&amp; board.get(trayIndex).getPlayer() == currentPlayer &amp;&amp; !board.get(trayIndex).isStore()){
              stones--;
              stealStones(trayIndex);
          }else{
              stones--;
              board.get(trayIndex).incrementStones();
          }
      }
  }
  </code></pre>
  
  <p>distributeStones moves stones around a game board that is represented as a List of Containers(both Stores and Trays).
  What would you test for?
  How can an assertion be used to test several possible outcomes dependent on the input?</p>
  
  <p>Thank you for your time,
  Chris </p>