title: JUnit Test failing and not sure why
body: <p>I'm pretty new to writing code and I am not the best, but I don't understand why my code isn't passing one of the JUnit tests I have set up.</p>
  
  <pre><code>public class PA3Test {
  
  
  public static void main(String[] args) { 
  }
  
  public static int countMajority(int count0, int count1, int count2) {
      int allVotes = (count0 + count1 + count2);
      int halfVotes = (allVotes / 2);
      int winner = 999;
      if (count0 &gt;= halfVotes) {
          winner = 0;
      } else {
          winner = -1;
      }
      if (count1 &gt;= halfVotes) {
          winner = 1;
      } else {
          winner = -1;
      }
      return winner;
  
  }
  </code></pre>
  
  <p>The test looks like this:</p>
  
  <pre><code>import junit.framework.TestCase;
  
  public class PA3TestTest extends TestCase {
  
  public static void testCountMajority() {
      assertEquals("0th param should win:", 0,
                   PA3Test.countMajority(100, 50, 40));
       assertEquals("1st param should win:", 1,
                   PA3Test.countMajority(50, 100, 40));
  }   
  </code></pre>
  
  <p>It is supposed to be returning 0 but it is returning -1. Any help is appreciated.</p>