title: Junit testing with multiple if statements
body: <p>Hey I am stuck in this homework junit exercise. I find it hard with the many if statements. Would be glad for some help. cheers. The idea with junit testing is that you call the methods and you test the variables.</p>
  
  <pre><code>package testing;
  
  import java.util.Map.Entry;
  
  public class HashMap&lt;K,V&gt; {
   static final int MAXIMUM_CAPACITY = 1 &lt;&lt; 10;
   transient Entry&lt;K,V&gt;[] table;
   int threshold;
   final float loadFactor;
  
  public HashMap(int initialCapacity, float loadFactor) {
    if (initialCapacity &lt; 0)
      throw new IllegalArgumentException("Illegal initial capacity: " +
    initialCapacity);
    if (initialCapacity &gt; MAXIMUM_CAPACITY)
      initialCapacity = MAXIMUM_CAPACITY;
    if (loadFactor &lt;= 0 || Float.isNaN(loadFactor))
      throw new IllegalArgumentException("Illegal load factor: " + loadFactor);
  
    // Find a power of 2 &gt;= initialCapacity
    int capacity = 1;
    while (capacity &lt; initialCapacity)
     capacity &lt;&lt;= 1;
   this.loadFactor = loadFactor;
   threshold = (int)(capacity * loadFactor);
   table = new Entry[capacity];
  }
  
  public int getCapacity() {
    return table.length;
  }
  }
  </code></pre>